linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: YASUAKI ISHIMATSU <yasu.isimatu@gmail.com>
Cc: linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>,
	qiuxishi@huawei.com, arbab@linux.vnet.ibm.com,
	Vlastimil Babka <vbabka@suse.cz>
Subject: Re: [PATCH] mm/memory_hotplug: fix wrong casting for __remove_section()
Date: Fri, 15 Sep 2017 11:36:56 +0200	[thread overview]
Message-ID: <20170915093656.jxnc55qhap3kswew@dhcp22.suse.cz> (raw)
In-Reply-To: <509197e7-135d-1304-76f1-32ae1fcbf223@gmail.com>

On Thu 14-09-17 11:43:10, YASUAKI ISHIMATSU wrote:
> Hi Michal,
> 
> On 09/13/2017 01:59 AM, Michal Hocko wrote:
> > On Tue 12-09-17 13:05:39, YASUAKI ISHIMATSU wrote:
> >> Hi Michal,
> >>
> >> Thanks you for reviewing my patch.
> >>
> >> On 09/12/2017 08:49 AM, Michal Hocko wrote:
> >>> On Fri 08-09-17 16:43:04, YASUAKI ISHIMATSU wrote:
> >>>> __remove_section() calls __remove_zone() to shrink zone and pgdat.
> >>>> But due to wrong castings, __remvoe_zone() cannot shrink zone
> >>>> and pgdat correctly if pfn is over 0xffffffff.
> >>>>
> >>>> So the patch fixes the following 3 wrong castings.
> >>>>
> >>>>   1. find_smallest_section_pfn() returns 0 or start_pfn which defined
> >>>>      as unsigned long. But the function always returns 32bit value
> >>>>      since the function is defined as int.
> >>>>
> >>>>   2. find_biggest_section_pfn() returns 0 or pfn which defined as
> >>>>      unsigned long. the function always returns 32bit value
> >>>>      since the function is defined as int.
> >>>
> >>> this is indeed wrong. Pfns over would be really broken 15TB. Not that
> >>> unrealistic these days
> >>
> >> Why 15TB?
> > 
> > 0xffffffff>>28
> > 
> 
> Even thought I see your explanation, I cannot understand.
> 
> In my understanding, find_{smallest|biggest}_section_pfn() return integer.
> So the functions always return 0x00000000 - 0xffffffff. Therefore if pfn is over
> 0xffffffff (under 16TB), then the function cannot work correctly.
> 
> What am I wrong?

You are not wrong. We are talking about the same thing AFAICS. I was
just less precise...

-- 
Michal Hocko
SUSE Labs

--
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>

      reply	other threads:[~2017-09-15  9:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-08 20:43 YASUAKI ISHIMATSU
2017-09-12 12:49 ` Michal Hocko
2017-09-12 17:05   ` YASUAKI ISHIMATSU
2017-09-13  5:59     ` Michal Hocko
2017-09-14 15:43       ` YASUAKI ISHIMATSU
2017-09-15  9:36         ` Michal Hocko [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=20170915093656.jxnc55qhap3kswew@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=arbab@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=qiuxishi@huawei.com \
    --cc=vbabka@suse.cz \
    --cc=yasu.isimatu@gmail.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