linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Dave Hansen <dave@sr71.net>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, cl@gentwo.org,
	kirill.shutemov@linux.intel.com, Andi Kleen <ak@linux.intel.com>,
	akpm@linux-foundation.org
Subject: Re: [PATCH 1/2] mm: slab/slub: use page->list consistently instead of page->lru
Date: Wed, 11 Dec 2013 14:45:23 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.02.1312111443130.7354@chino.kir.corp.google.com> (raw)
In-Reply-To: <20131211223631.51094A3D@viggo.jf.intel.com>

On Wed, 11 Dec 2013, Dave Hansen wrote:

> From: Dave Hansen <dave.hansen@linux.intel.com>
> 
> 'struct page' has two list_head fields: 'lru' and 'list'.
> Conveniently, they are unioned together.  This means that code
> can use them interchangably, which gets horribly confusing like
> with this nugget from slab.c:
> 
> >	list_del(&page->lru);
> >	if (page->active == cachep->num)
> >		list_add(&page->list, &n->slabs_full);
> 
> This patch makes the slab and slub code use page->list
> universally instead of mixing ->list and ->lru.
> 
> It also adds some comments to attempt to keep new users from
> picking up uses of ->list.
> 
> So, the new rule is: page->list is what the slabs use.  page->lru
> is for everybody else.  This is a pretty arbitrary rule, but we
> need _something_.  Maybe we should just axe the ->list one and
> make the sl?bs use ->lru.
> 

I'd recommend this suggestion, I don't see why the slab allocators can't 
use a page->lru field to maintain their lists of slab pages and it makes 
the code much cleaner.  Anybody hacking thise code will know it's not 
really a lru and we're just reusing a field from struct page without 
adding unnecessary complexity.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2013-12-11 22:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11 22:36 Dave Hansen
2013-12-11 22:36 ` [PATCH 2/2] mm: blk-mq: uses page->list incorrectly Dave Hansen
2013-12-11 22:47   ` David Rientjes
2013-12-12 13:16   ` Kirill A. Shutemov
2013-12-11 22:45 ` David Rientjes [this message]
2013-12-12 17:39 ` [PATCH 1/2] mm: slab/slub: use page->list consistently instead of page->lru Christoph 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=alpine.DEB.2.02.1312111443130.7354@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@gentwo.org \
    --cc=dave@sr71.net \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --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