From: David Rientjes <rientjes@google.com>
To: Christoph Lameter <cl@linux-foundation.org>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>, linux-mm@kvack.org
Subject: Re: slub: discard_slab_unlock
Date: Fri, 18 Jun 2010 14:44:22 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.2.00.1006181438020.16115@chino.kir.corp.google.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1006151405020.10865@router.home>
On Tue, 15 Jun 2010, Christoph Lameter wrote:
> Subject: slub: discard_slab_unlock
>
> The sequence of unlocking a slab and freeing occurs multiple times.
> Put the common into a single function.
>
I personally don't see the benefit in this patch, it simply makes it
harder for me to find if there are unmatched slab_lock() -> slab_unlock().
There's no compelling reason to have it and, if done in a generic
subsystem, we'd have an infinite number of these unlocking functions to
enforce an order that should otherwise be pretty clear.
That said, I think something like the following would be better if
nothing more than to annotate the code (we tend to read code better than
comments :) about the rules:
diff --git a/mm/slub.c b/mm/slub.c
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1233,6 +1233,7 @@ static void free_slab(struct kmem_cache *s, struct page *page)
static void discard_slab(struct kmem_cache *s, struct page *page)
{
+ BUG_ON(bit_spin_is_locked(PG_locked, &page->flags));
dec_slabs_node(s, page_to_nid(page), page->objects);
free_slab(s, page);
}
--
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>
prev parent reply other threads:[~2010-06-18 21:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-15 19:05 Christoph Lameter
2010-06-18 21:44 ` David Rientjes [this message]
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.00.1006181438020.16115@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=cl@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=penberg@cs.helsinki.fi \
/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