Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753553AbdDJPWd (ORCPT ); Mon, 10 Apr 2017 11:22:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:36067 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752841AbdDJPWc (ORCPT ); Mon, 10 Apr 2017 11:22:32 -0400 Date: Mon, 10 Apr 2017 17:22:28 +0200 From: Michal Hocko To: Igor Mammedov Cc: linux-mm@kvack.org, Andrew Morton , Mel Gorman , Vlastimil Babka , Andrea Arcangeli , Jerome Glisse , Reza Arbab , Yasuaki Ishimatsu , qiuxishi@huawei.com, Kani Toshimitsu , slaoub@gmail.com, Joonsoo Kim , Andi Kleen , David Rientjes , Daniel Kiper , Vitaly Kuznetsov , LKML , Dan Williams , Heiko Carstens , Martin Schwidefsky , Tobias Regnery Subject: Re: [PATCH -v2 0/9] mm: make movable onlining suck less Message-ID: <20170410152228.GF4618@dhcp22.suse.cz> References: <20170410110351.12215-1-mhocko@kernel.org> <20170410162749.7d7f31c1@nial.brq.redhat.com> <20170410145639.GE4618@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170410145639.GE4618@dhcp22.suse.cz> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2421 Lines: 67 [dropping Lai Jiangshan whose email bounces] On Mon 10-04-17 16:56:39, Michal Hocko wrote: > On Mon 10-04-17 16:27:49, Igor Mammedov wrote: > [...] > > Hi Michal, > > > > I've given series some dumb testing, see below for unexpected changes I've noticed. > > > > Using the same CLI as above plus hotpluggable dimms present at startup > > (it still uses hotplug path as dimms aren't reported in e820) > > > > -object memory-backend-ram,id=mem1,size=256M -object memory-backend-ram,id=mem0,size=256M \ > > -device pc-dimm,id=dimm1,memdev=mem1,slot=1,node=0 -device pc-dimm,id=dimm0,memdev=mem0,slot=0,node=0 > > > > so dimm1 => memory3[23] and dimm0 => memory3[45] > > > > #issue1: > > unable to online memblock as NORMAL adjacent to onlined MOVABLE > > > > 1: after boot > > memory32:offline removable: 0 zones: Normal Movable > > memory33:offline removable: 0 zones: Normal Movable > > memory34:offline removable: 0 zones: Normal Movable > > memory35:offline removable: 0 zones: Normal Movable > > > > 2: online as movable 1st dimm > > > > #echo online_movable > memory32/state > > #echo online_movable > memory33/state > > > > everything is as expected: > > memory32:online removable: 1 zones: Movable > > memory33:online removable: 1 zones: Movable > > memory34:offline removable: 0 zones: Movable > > memory35:offline removable: 0 zones: Movable > > > > 3: try to offline memory32 and online as NORMAL > > > > #echo offline > memory32/state > > memory32:offline removable: 1 zones: Normal Movable > > memory33:online removable: 1 zones: Movable > > memory34:offline removable: 0 zones: Movable > > memory35:offline removable: 0 zones: Movable > > OK, this is not expected. We are not shifting zones anymore so the range > which was online_movable will not become available to the zone Normal. > So this must be something broken down the show_valid_zones path. I will > investigate. Heh, this one is embarrassing diff --git a/drivers/base/memory.c b/drivers/base/memory.c index 1c6fdacbccd3..9677b6b711b0 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c @@ -402,7 +402,7 @@ static ssize_t show_valid_zones(struct device *dev, return sprintf(buf, "none\n"); start_pfn = valid_start_pfn; - nr_pages = valid_end_pfn - valid_end_pfn; + nr_pages = valid_end_pfn - start_pfn; /* * Check the existing zone. Make sure that we do that only on the -- Michal Hocko SUSE Labs