From: Hugh Dickins <hugh@veritas.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Dave Hansen <haveblue@us.ibm.com>,
Balbir Singh <balbir@linux.vnet.ibm.com>,
LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] Move page_assign_page_cgroup to VM_BUG_ON in free_hot_cold_page
Date: Thu, 20 Dec 2007 14:16:14 +0000 (GMT) [thread overview]
Message-ID: <Pine.LNX.4.64.0712201411510.22773@blonde.wat.veritas.com> (raw)
In-Reply-To: <1198158702.6821.8.camel@twins>
On Thu, 20 Dec 2007, Peter Zijlstra wrote:
> On Thu, 2007-12-20 at 13:14 +0000, Hugh Dickins wrote:
> > On Wed, 19 Dec 2007, Dave Hansen wrote:
> > > > - page_assign_page_cgroup(page, NULL);
> > > > + VM_BUG_ON(page_get_page_cgroup(page));
> > >
> > > Hi Balbir,
> > >
> > > You generally want to do these like:
> > >
> > > foo = page_assign_page_cgroup(page, NULL);
> > > VM_BUG_ON(foo);
> > >
> > > Some embedded people have been known to optimize kernel size like this:
> > >
> > > #define VM_BUG_ON(x) do{}while(0)
> >
> > Balbir's patch looks fine to me: I don't get your point there, Dave.
>
> There was a lengthy discussion here:
> http://lkml.org/lkml/2007/12/14/131
>
> on the merit of debug statements with side effects.
Of course, but what's the relevance?
> But looking at our definition:
>
> #ifdef CONFIG_DEBUG_VM
> #define VM_BUG_ON(cond) BUG_ON(cond)
> #else
> #define VM_BUG_ON(condition) do { } while(0)
> #endif
>
> disabling CONFIG_DEBUG_VM breaks the code as proposed by Balbir in that
> it will no longer acquire the reference.
But what reference?
struct page_cgroup *page_get_page_cgroup(struct page *page)
{
return (struct page_cgroup *)
(page->page_cgroup & ~PAGE_CGROUP_LOCK);
}
I guess the issue is that often a "get" function has a complementary
"put" function, but this isn't one of them. Would page_page_cgroup
be a better name, perhaps? I don't know.
Hugh
next prev parent reply other threads:[~2007-12-20 14:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-19 6:18 Balbir Singh
2007-12-19 17:14 ` Dave Hansen
2007-12-20 13:14 ` Hugh Dickins
2007-12-20 13:51 ` Peter Zijlstra
2007-12-20 14:16 ` Hugh Dickins [this message]
2007-12-20 14:20 ` Peter Zijlstra
2007-12-20 16:24 ` Balbir Singh
2007-12-20 16:35 ` Dave Hansen
2007-12-20 17:12 ` Andrew Morton
2007-12-20 17:21 ` Hugh Dickins
2007-12-20 17:39 ` Balbir Singh
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=Pine.LNX.4.64.0712201411510.22773@blonde.wat.veritas.com \
--to=hugh@veritas.com \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=haveblue@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.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
all inboxes | Powered by JetHome®