Received: by 10.192.165.148 with SMTP id m20csp2509790imm; Thu, 26 Apr 2018 12:13:22 -0700 (PDT) X-Google-Smtp-Source: AIpwx49e6e22HbosasX1WuIRTWQSDaHUYR3ndMn+Fl1G4YWfhK+p8/CMsCAMKLh9AtZ4/gx8GTR4 X-Received: by 10.98.12.202 with SMTP id 71mr33448173pfm.61.1524770002250; Thu, 26 Apr 2018 12:13:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524770002; cv=none; d=google.com; s=arc-20160816; b=jbzVlfqx6pXrwGtz6XauCFB82H21hgoQo7Twz5cdZuboBcYEIdbbNALI1nk5IvmX9g 8Ob9gUxSfj5TAnyvR/vsOuq2z27TPlyfBTjPFSQxQwBprbFEeLr6jLdjg56/kGr0c+af HT3RH96b7XKM1zkA9yU2sBeN8HZI6kHCOQaVUhstbLVCdUF4vKH2XVQaG8+oFJ/27pHO mENjO0a81WLG5UUWZvcgU8J4TrUD1YME6RJ3gcDXlglXXA/12NWjx+yInbxwd9kRo3xM jTzSYDINu6j/CSL7+i04UDcJYbn5UWrFoj9HuqclCPtiVGEMpoX5Flag6pAPnSJsNCDK LRSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=OZNutcTeqRSsDDgg+VwgXZX5rHjaaudNEtUNE61K544=; b=WbtOPmW2zrkasRVBIOORehi9B0w2h3UIWXDB0ntO+Ki7keQDxdoRyEFW/h3IZdr0nz +8fdwIjCo4ibzUBtSohUwIEolCBP6/jCL4m1idKkO71pIk15PpBE1/3Klphm44ZJ5NSK 34yTHNiH3CBtkeuU8bd5E3Im9isVrIdyiuAzk41Vwi5+oS5yX3UHyCYprBXFWkWMyV+D X149/0uvHu7bwxcMxhDlaQdXpSek6i7IwqQkiDbUdP6jNujwDVWi89yjAubGxuNCys8A RWx33jXrKnzo8PV0r8fNXI5dgEfFciNIk+vMzwvSnAvpmzwtm1Tcl4hMx2XuAAyq3+o/ U6Xg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w9si16203895pgc.181.2018.04.26.12.13.08; Thu, 26 Apr 2018 12:13:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752872AbeDZTLz (ORCPT + 99 others); Thu, 26 Apr 2018 15:11:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:37864 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751128AbeDZTLy (ORCPT ); Thu, 26 Apr 2018 15:11:54 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 0C7D4AD7F; Thu, 26 Apr 2018 19:11:53 +0000 (UTC) Date: Thu, 26 Apr 2018 21:11:52 +0200 From: Michal Hocko To: Pavel Tatashin Cc: steven.sistare@oracle.com, daniel.m.jordan@oracle.com, akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] mm: sections are not offlined during memory hotremove Message-ID: <20180426191152.GW17484@dhcp22.suse.cz> References: <20180426155834.16845-1-pasha.tatashin@oracle.com> <20180426191111.GV17484@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180426191111.GV17484@dhcp22.suse.cz> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 26-04-18 21:11:11, Michal Hocko wrote: > On Thu 26-04-18 11:58:34, Pavel Tatashin wrote: > > Memory hotplug, and hotremove operate with per-block granularity. If > > machine has large amount of memory (more than 64G), the size of memory > > block can span multiple sections. By mistake, during hotremove we set > > only the first section to offline state. > > > > The bug was discovered because kernel selftest started to fail: > > https://lkml.kernel.org/r/20180423011247.GK5563@yexl-desktop > > > > After commit, "mm/memory_hotplug: optimize probe routine". But, the bug is > > older than this commit. In this optimization we also added a check for > > sections to be in a proper state during hotplug operation. > > > > Fixes: 2d070eab2e82 ("mm: consider zone which is not fully populated to have holes") > > Dohh. When I saw this I've had that feeling that I have fixed this > already and it must have get lost somewhere. But no, this was the same > bug in a different path b4ccec41af82 ("mm/sparse.c: fix typo in > online_mem_sections"). I wonder why I haven't noticed the same pattern > in the offline path. > > Thanks for noticing and fixing this. > > > Signed-off-by: Pavel Tatashin > > Acked-by: Michal Hocko Btw. Cc: stable would be appropriate. > > > mm/sparse.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/mm/sparse.c b/mm/sparse.c > > index 62eef264a7bd..73dc2fcc0eab 100644 > > --- a/mm/sparse.c > > +++ b/mm/sparse.c > > @@ -629,7 +629,7 @@ void offline_mem_sections(unsigned long start_pfn, unsigned long end_pfn) > > unsigned long pfn; > > > > for (pfn = start_pfn; pfn < end_pfn; pfn += PAGES_PER_SECTION) { > > - unsigned long section_nr = pfn_to_section_nr(start_pfn); > > + unsigned long section_nr = pfn_to_section_nr(pfn); > > struct mem_section *ms; > > > > /* > > -- > > 1.8.3.1 > > > > -- > Michal Hocko > SUSE Labs -- Michal Hocko SUSE Labs