linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Christopher Lameter <cl@linux.com>
Cc: linux-mm@kvack.org
Subject: Re: [PATCH] slub: Remove use of page->counter
Date: Mon, 16 Apr 2018 06:53:21 -0700	[thread overview]
Message-ID: <20180416135321.GD26022@bombadil.infradead.org> (raw)
In-Reply-To: <20180411182606.GA22494@bombadil.infradead.org>

On Wed, Apr 11, 2018 at 11:26:06AM -0700, Matthew Wilcox wrote:
> I had a Thought.  And it seems to work:

Now I realised that slub doesn't use s_mem.  That gives us more space
to use for pages/pobjects.

struct page {
	unsigned long flags;
	union {		/* Five words */
		struct {	/* Page cache & anonymous pages */
			struct list_head lru;
			unsigned long private;
			struct address_space *mapping;
			pgoff_t index;
		};
		struct {	/* Slob */
			struct list_head slob_list;
			int units;
		};
		struct {	/* Slab */
			struct kmem_cache *slab_cache;
			void *freelist;
			void *s_mem;
			unsigned int active;
		};
		struct {	/* Slub */
			struct kmem_cache *slub_cache;
			/* Dword boundary */
			void *slub_freelist;
			unsigned short inuse;
			unsigned short objects:15;
			unsigned short frozen:1;
			struct page *next;
#ifdef CONFIG_64BIT
			int pobjects;
			int pages;
#endif
			short int pages;
			short int pobjects;
#endif
		};
		struct rcu_head rcu_head;
		... tail pages, page tables, etc, etc ...
	};
	union {
		atomic_t _mapcount;
		unsigned int page_type;
	};
	atomic_t _refcount;
	struct mem_cgroup *mem_cgroup;
};

> Now everybody gets 5 contiguous words to use as they want with the only
> caveat that they can't use bit 0 of the first word (PageTail).

^^^ still true ;-)

I'd want to change slob to use slob_list instead of ->lru.  Or maybe even do
something radical like _naming_ the struct in the union so we don't have to
manually namespace the names of the elements.

  reply	other threads:[~2018-04-16 13:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-10 19:54 Matthew Wilcox
2018-04-10 20:47 ` Christopher Lameter
2018-04-10 20:57   ` Matthew Wilcox
2018-04-10 22:03     ` Christopher Lameter
2018-04-11 18:26       ` Matthew Wilcox
2018-04-16 13:53         ` Matthew Wilcox [this message]
2018-04-16 15:08           ` Christopher Lameter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180416135321.GD26022@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=cl@linux.com \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox