Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1732800
| From | Michal Hocko <mhocko@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] mm/memory_hotplug: fix wrong casting for __remove_section() |
| Date | 2017-09-15 11:40 +0200 |
| Message-ID | <upVgm-Wh-3@gated-at.bofh.it> (permalink) |
| References | <unynT-3Hn-1@gated-at.bofh.it> <uoSXg-1pc-19@gated-at.bofh.it> <uoWRe-43L-41@gated-at.bofh.it> <up8Sl-3ks-3@gated-at.bofh.it> <upEyS-6RC-23@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH] mm/memory_hotplug: fix wrong casting for __remove_section() Michal Hocko <mhocko@kernel.org> - 2017-09-12 15:00 +0200
Re: [PATCH] mm/memory_hotplug: fix wrong casting for __remove_section() YASUAKI ISHIMATSU <yasu.isimatu@gmail.com> - 2017-09-12 19:10 +0200
Re: [PATCH] mm/memory_hotplug: fix wrong casting for __remove_section() Michal Hocko <mhocko@kernel.org> - 2017-09-13 08:00 +0200
Re: [PATCH] mm/memory_hotplug: fix wrong casting for __remove_section() YASUAKI ISHIMATSU <yasu.isimatu@gmail.com> - 2017-09-14 17:50 +0200
Re: [PATCH] mm/memory_hotplug: fix wrong casting for __remove_section() Michal Hocko <mhocko@kernel.org> - 2017-09-15 11:40 +0200
csiph-web