From: Johannes Weiner <hannes@cmpxchg.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
minchan.kim@gmail.com, riel@redhat.com, wli@movementarian.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] vmscan: initialize sc->nr_reclaimed properly take2
Date: Tue, 10 Feb 2009 23:15:42 +0100 [thread overview]
Message-ID: <20090210221542.GA3672@cmpxchg.org> (raw)
In-Reply-To: <20090210140637.902e4dcc.akpm@linux-foundation.org>
On Tue, Feb 10, 2009 at 02:06:37PM -0800, Andrew Morton wrote:
> On Tue, 10 Feb 2009 21:58:04 +0900 (JST)
> KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote:
>
> > --- a/mm/vmscan.c
> > +++ b/mm/vmscan.c
> > @@ -1665,6 +1665,7 @@ unsigned long try_to_free_pages(struct z
> > gfp_t gfp_mask)
> > {
> > struct scan_control sc = {
> > + .nr_reclaimed = 0,
> > .gfp_mask = gfp_mask,
> > .may_writepage = !laptop_mode,
> > .swap_cluster_max = SWAP_CLUSTER_MAX,
> > @@ -1686,6 +1687,7 @@ unsigned long try_to_free_mem_cgroup_pag
> > unsigned int swappiness)
> > {
> > struct scan_control sc = {
> > + .nr_reclaimed = 0,
> > .may_writepage = !laptop_mode,
> > .may_swap = 1,
> > .swap_cluster_max = SWAP_CLUSTER_MAX,
> > @@ -2245,6 +2247,7 @@ static int __zone_reclaim(struct zone *z
> > struct reclaim_state reclaim_state;
> > int priority;
> > struct scan_control sc = {
> > + .nr_reclaimed = 0,
> > .may_writepage = !!(zone_reclaim_mode & RECLAIM_WRITE),
> > .may_swap = !!(zone_reclaim_mode & RECLAIM_SWAP),
> > .swap_cluster_max = max_t(unsigned long, nr_pages,
>
> Confused. The compiler already initialises any unmentioned fields to zero,
> so this patch has no effect.
Oh, nice, I was actually testing the wrong thing!
struct foo foo;
wouldn't do that. But
struct foo foo = { .a = 5 };
actually would initialize foo.b = 0.
Sorry. Please ignore this patch and the other one regarding the
explicit initialization of sc.order. :(
Hannes
--
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>
next prev parent reply other threads:[~2009-02-10 22:16 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-09 22:24 [RFC] vmscan: initialize sc->nr_reclaimed in do_try_to_free_pages() Johannes Weiner
2009-02-10 10:47 ` MinChan Kim
2009-02-10 11:43 ` KOSAKI Motohiro
2009-02-10 12:03 ` MinChan Kim
2009-02-10 12:06 ` KOSAKI Motohiro
2009-02-10 12:31 ` MinChan Kim
2009-02-10 12:35 ` KOSAKI Motohiro
2009-02-10 12:40 ` MinChan Kim
2009-02-10 12:58 ` [PATCH] vmscan: initialize sc->nr_reclaimed properly take2 KOSAKI Motohiro
2009-02-10 13:00 ` [PATCH] shrink_all_memory() use sc.nr_reclaimed KOSAKI Motohiro
2009-02-10 16:20 ` Johannes Weiner
2009-02-10 20:41 ` KOSAKI Motohiro
2009-02-11 0:37 ` MinChan Kim
2009-02-11 11:50 ` KOSAKI Motohiro
2009-02-11 12:43 ` MinChan Kim
2009-02-11 12:58 ` KOSAKI Motohiro
2009-02-11 13:03 ` KOSAKI Motohiro
2009-02-10 16:09 ` [PATCH] vmscan: initialize sc->nr_reclaimed properly take2 Johannes Weiner
2009-02-10 22:06 ` Andrew Morton
2009-02-10 22:15 ` Johannes Weiner [this message]
2009-02-11 10:52 ` KOSAKI Motohiro
2009-02-10 22:16 ` [RFC] vmscan: initialize sc->nr_reclaimed in do_try_to_free_pages() Andrew Morton
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=20090210221542.GA3672@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akpm@linux-foundation.org \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan.kim@gmail.com \
--cc=riel@redhat.com \
--cc=wli@movementarian.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