From: Arun KS <arunks@codeaurora.org>
To: Michal Hocko <mhocko@kernel.org>
Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>,
arunks.linux@gmail.com, akpm@linux-foundation.org,
vbabka@suse.cz, osalvador@suse.de, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, getarunks@gmail.com
Subject: Re: [PATCH v7] mm/page_alloc.c: memory_hotplug: free pages as higher order
Date: Wed, 09 Jan 2019 16:12:48 +0530 [thread overview]
Message-ID: <e005e71b125b9b8ddee668d1df9ad5ec@codeaurora.org> (raw)
In-Reply-To: <20190109084031.GN31793@dhcp22.suse.cz>
On 2019-01-09 14:10, Michal Hocko wrote:
> On Wed 09-01-19 13:58:50, Arun KS wrote:
>> On 2019-01-09 13:07, Michal Hocko wrote:
>> > On Wed 09-01-19 11:28:52, Arun KS wrote:
>> > > On 2019-01-08 23:43, Michal Hocko wrote:
>> > > > On Tue 08-01-19 09:56:09, Alexander Duyck wrote:
>> > > > > On Fri, 2019-01-04 at 10:31 +0530, Arun KS wrote:
>> > > > [...]
>> > > > > > static int online_pages_range(unsigned long start_pfn, unsigned long nr_pages,
>> > > > > > void *arg)
>> > > > > > {
>> > > > > > - unsigned long i;
>> > > > > > unsigned long onlined_pages = *(unsigned long *)arg;
>> > > > > > - struct page *page;
>> > > > > >
>> > > > > > if (PageReserved(pfn_to_page(start_pfn)))
>> > > > > > - for (i = 0; i < nr_pages; i++) {
>> > > > > > - page = pfn_to_page(start_pfn + i);
>> > > > > > - (*online_page_callback)(page);
>> > > > > > - onlined_pages++;
>> > > > > > - }
>> > > > > > + onlined_pages = online_pages_blocks(start_pfn, nr_pages);
>> > > > >
>> > > > > Shouldn't this be a "+=" instead of an "="? It seems like you are
>> > > > > going
>> > > > > to lose your count otherwise.
>> > > >
>> > > > You are right of course. I should have noticed during the review.
>> > > > Thanks!
>> > >
>> > > I think we don't need to. The caller function is setting
>> > > onlined_pages = 0
>> > > before calling online_pages_range().
>> > > And there are no other reference to online_pages_range other than from
>> > > online_pages().
>> >
>> > Are you missing that we accumulate onlined_pages via
>> > *(unsigned long *)arg = onlined_pages;
>> > in online_pages_range?
>>
>> In my testing I didn't find any problem. To match the code being
>> replaced
>> and to avoid any corner cases, it is better to use +=
>> Will update the patch.
>
> Have you checked that the number of present pages both in the zone and
> the node is correct because I fail to see how that would be possible.
Yes they are showing correct values.
Previous value of cat /proc/zoneinfo,
Node 0, zone Normal
pages free 65492
min 300
low 375
high 450
spanned 65536
present 65536
managed 65536
Value after hotadd,
Node 0, zone Normal
pages free 129970
min 518
low 649
high 780
spanned 983040
present 131072
managed 131072
I added prints in online_pages_range function.
It will be called once per online of a section and the arg value is
always set to 0 while entering online_pages_range.
/sys/devices/system/memory # echo online > memory16/state
[ 52.956558] online_pages_range start_pfn = 100000 nr_pages = 65536
arg = 0
[ 52.964104] Built 1 zonelists, mobility grouping on. Total pages:
187367
[ 52.964828] Policy zone: Normal
But still I'll change to += to match with the previous code.
Regards,
Arun
next prev parent reply other threads:[~2019-01-09 10:42 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-04 5:01 Arun KS
2019-01-08 17:56 ` Alexander Duyck
2019-01-08 17:56 ` Alexander Duyck
2019-01-08 18:13 ` Michal Hocko
2019-01-09 5:58 ` Arun KS
2019-01-09 7:37 ` Michal Hocko
2019-01-09 8:28 ` Arun KS
2019-01-09 8:40 ` Michal Hocko
2019-01-09 10:42 ` Arun KS [this message]
2019-01-09 10:57 ` Michal Hocko
2019-01-09 11:06 ` Arun KS
2019-01-09 18:56 ` Andrew Morton
2019-01-10 5:06 ` Arun KS
2019-01-08 18:40 ` Alexander Duyck
2019-01-08 18:40 ` Alexander Duyck
2019-01-08 20:04 ` Michal Hocko
2019-01-08 21:53 ` Alexander Duyck
2019-01-08 21:53 ` Alexander Duyck
2019-01-08 22:17 ` Alexander Duyck
2019-01-08 22:17 ` Alexander Duyck
2019-01-09 6:21 ` Arun KS
2019-01-09 16:09 ` Alexander Duyck
2019-01-09 16:09 ` Alexander Duyck
2019-01-10 4:39 ` Arun KS
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=e005e71b125b9b8ddee668d1df9ad5ec@codeaurora.org \
--to=arunks@codeaurora.org \
--cc=akpm@linux-foundation.org \
--cc=alexander.h.duyck@linux.intel.com \
--cc=arunks.linux@gmail.com \
--cc=getarunks@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=osalvador@suse.de \
--cc=vbabka@suse.cz \
/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