From: Minchan Kim <minchan.kim@gmail.com>
To: Greg Thelen <gthelen@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
containers@lists.osdl.org, Andrea Righi <arighi@develer.com>,
Balbir Singh <balbir@linux.vnet.ibm.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>,
Ciju Rajan K <ciju@linux.vnet.ibm.com>,
David Rientjes <rientjes@google.com>,
Wu Fengguang <fengguang.wu@intel.com>,
Chad Talbott <ctalbott@google.com>,
Justin TerAvest <teravest@google.com>,
Vivek Goyal <vgoyal@redhat.com>
Subject: Re: [PATCH v5 3/9] writeback: convert variables to unsigned
Date: Tue, 1 Mar 2011 13:50:25 +0900 [thread overview]
Message-ID: <20110301045025.GC2107@barrios-desktop> (raw)
In-Reply-To: <AANLkTik7LfGfYpteufr68AqEe3wUriJKgAMkmT8pJSzZ@mail.gmail.com>
On Mon, Feb 28, 2011 at 03:52:53PM -0800, Greg Thelen wrote:
> On Sun, Feb 27, 2011 at 8:07 AM, Minchan Kim <minchan.kim@gmail.com> wrote:
> > On Fri, Feb 25, 2011 at 01:35:54PM -0800, Greg Thelen wrote:
> >> Convert two balance_dirty_pages() page counter variables (nr_reclaimable
> >> and nr_writeback) from 'long' to 'unsigned long'.
> >>
> >> These two variables are used to store results from global_page_state().
> >> global_page_state() returns unsigned long and carefully sums per-cpu
> >> counters explicitly avoiding returning a negative value.
> >>
> >> Signed-off-by: Greg Thelen <gthelen@google.com>
> > Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
> >
> >> ---
> >> Changelog since v4:
> >> - Created this patch for clarity. Previously this patch was integrated within
> >> the "writeback: create dirty_info structure" patch.
> >>
> >> mm/page-writeback.c | 6 ++++--
> >> 1 files changed, 4 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/mm/page-writeback.c b/mm/page-writeback.c
> >> index 2cb01f6..4408e54 100644
> >> --- a/mm/page-writeback.c
> >> +++ b/mm/page-writeback.c
> >> @@ -478,8 +478,10 @@ unsigned long bdi_dirty_limit(struct backing_dev_info *bdi, unsigned long dirty)
> >> static void balance_dirty_pages(struct address_space *mapping,
> >> unsigned long write_chunk)
> >> {
> >> - long nr_reclaimable, bdi_nr_reclaimable;
> >> - long nr_writeback, bdi_nr_writeback;
> >> + unsigned long nr_reclaimable;
> >> + long bdi_nr_reclaimable;
> >> + unsigned long nr_writeback;
> >> + long bdi_nr_writeback;
> >> unsigned long background_thresh;
> >> unsigned long dirty_thresh;
> >> unsigned long bdi_thresh;
> >> --
> >> 1.7.3.1
> >>
> > bdi_nr_[reclaimable|writeback] can return negative value?
> > When I just look through bdi_stat_sum, it uses *percpu_counter_sum_positive*.
> > So I guess it always returns positive value.
> > If it is right, could you change it, too?
>
> Yes, I think we can also change bdi_nr_[reclaimable|writeback] to unsigned long.
>
> bdi_stat_sum() and bdi_stat() both call percpu_counter_sum_positive(),
> which return a positive number. bdi_stat[_sum]() return s64. Should
> we also change bdi_stat[_sum]() to return unsigned long rather than
> s64? I would like the return value type to match the type of the
> corresponding local variables in balance_dirty_pages(). All current
> callers appear to expect bdi_stat[_sum]() to return unsigned long.
Please, clear them, too.
But this patch could be orthogonal with your series so it's up to you. :)
>
> > --
> > Kind regards,
> > Minchan Kim
> >
--
Kind regards,
Minchan Kim
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-03-01 4:50 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-25 21:35 [PATCH v5 0/9] memcg: per cgroup dirty page accounting Greg Thelen
2011-02-25 21:35 ` [PATCH v5 1/9] memcg: document cgroup dirty memory interfaces Greg Thelen
2011-02-28 2:27 ` KAMEZAWA Hiroyuki
2011-03-11 10:19 ` Balbir Singh
2011-02-25 21:35 ` [PATCH v5 2/9] memcg: add page_cgroup flags for dirty page tracking Greg Thelen
2011-02-27 15:56 ` Minchan Kim
2011-02-25 21:35 ` [PATCH v5 3/9] writeback: convert variables to unsigned Greg Thelen
2011-02-27 16:07 ` Minchan Kim
2011-02-28 23:52 ` Greg Thelen
2011-03-01 4:50 ` Minchan Kim [this message]
2011-02-28 2:28 ` KAMEZAWA Hiroyuki
2011-02-25 21:35 ` [PATCH v5 4/9] writeback: create dirty_info structure Greg Thelen
2011-02-27 16:38 ` Minchan Kim
2011-03-01 21:13 ` Greg Thelen
2011-02-25 21:35 ` [PATCH v5 5/9] memcg: add dirty page accounting infrastructure Greg Thelen
2011-02-27 16:47 ` Minchan Kim
2011-02-28 2:34 ` KAMEZAWA Hiroyuki
2011-02-25 21:35 ` [PATCH v5 6/9] memcg: add kernel calls for memcg dirty page stats Greg Thelen
2011-02-27 17:01 ` Minchan Kim
2011-02-28 2:40 ` KAMEZAWA Hiroyuki
2011-03-10 16:18 ` Greg Thelen
2011-02-25 21:35 ` [PATCH v5 7/9] memcg: add dirty limits to mem_cgroup Greg Thelen
2011-02-28 2:46 ` KAMEZAWA Hiroyuki
2011-02-25 21:35 ` [PATCH v5 8/9] memcg: add cgroupfs interface to memcg dirty limits Greg Thelen
2011-02-25 21:36 ` [PATCH v5 9/9] memcg: check memcg dirty limits in page writeback Greg Thelen
2011-03-01 4:44 ` Minchan Kim
2011-03-02 23:17 ` Vivek Goyal
2011-03-04 0:30 ` Greg Thelen
2011-02-26 4:16 ` [PATCH v5 0/9] memcg: per cgroup dirty page accounting Greg Thelen
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=20110301045025.GC2107@barrios-desktop \
--to=minchan.kim@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=arighi@develer.com \
--cc=balbir@linux.vnet.ibm.com \
--cc=ciju@linux.vnet.ibm.com \
--cc=containers@lists.osdl.org \
--cc=ctalbott@google.com \
--cc=fengguang.wu@intel.com \
--cc=gthelen@google.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nishimura@mxp.nes.nec.co.jp \
--cc=rientjes@google.com \
--cc=teravest@google.com \
--cc=vgoyal@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).