lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190313080105.GG5721@dhcp22.suse.cz>
Date:   Wed, 13 Mar 2019 09:01:05 +0100
From:   Michal Hocko <mhocko@...nel.org>
To:     Oscar Salvador <osalvador@...e.de>
Cc:     Qian Cai <cai@....pw>, akpm@...ux-foundation.org, vbabka@...e.cz,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/hotplug: fix offline undo_isolate_page_range()

On Wed 13-03-19 08:52:16, Oscar Salvador wrote:
> On Tue, Mar 12, 2019 at 09:42:16PM -0400, Qian Cai wrote:
> > +
> > +	/*
> > +	 * Onlining will reset pagetype flags and makes migrate type
> > +	 * MOVABLE, so just need to decrease the number of isolated
> > +	 * pageblocks zone counter here.
> > +	 */
> > +	for (pfn = start_pfn; pfn < end_pfn; pfn += pageblock_nr_pages) {
> > +		int i;
> > +
> > +		for (i = 0; i < pageblock_nr_pages; i++)
> > +			if (pfn_valid_within(pfn + i)) {
> > +				zone->nr_isolate_pageblock--;
> > +				break;
> > +			}
> > +	}
> > +
> 
> I do not really like this.
> 
> I first thought about saving the value before entering start_isolate_page_range,
> but that could race with alloc_contig_range for instance.

Yup. We need to take the zone lock.

> So, why not make start_isolate_page_range to return the actual number of isolated
> pageblocks?

That makes more sense indeed.

-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ