Re: [PATCH v4 07/16] slub: Remove page->counters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 02, 2018 at 05:26:39PM +0000, Matthew Wilcox wrote:
> Option 2:
> 
> @@ -113,9 +113,14 @@ struct page {
>                         struct kmem_cache *slub_cache;  /* shared with slab */
>                         /* Double-word boundary */
>                         void *slub_freelist;            /* shared with slab */
> -                       unsigned inuse:16;
> -                       unsigned objects:15;
> -                       unsigned frozen:1;
> +                       union {
> +                               unsigned long counters;
> +                               struct {
> +                                       unsigned inuse:16;
> +                                       unsigned objects:15;
> +                                       unsigned frozen:1;
> +                               };
> +                       };
>                 };
>                 struct {        /* Tail pages of compound page */
>                         unsigned long compound_head;    /* Bit zero is set */
> 
> Pro: Expresses exactly what we do.
> Con: Back to five levels of indentation in struct page

The indentation issue can be fixed (to some extend) by declaring the union
outside struct page and just use it inside.

I don't advocate for the approach, just listing the option.

-- 
 Kirill A. Shutemov




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux