From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 104A3C4BA0B for ; Wed, 26 Feb 2020 09:10:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CE6662084E for ; Wed, 26 Feb 2020 09:10:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CE6662084E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7D83A6B0003; Wed, 26 Feb 2020 04:10:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7883A6B0005; Wed, 26 Feb 2020 04:10:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C6156B0006; Wed, 26 Feb 2020 04:10:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0118.hostedemail.com [216.40.44.118]) by kanga.kvack.org (Postfix) with ESMTP id 535DC6B0003 for ; Wed, 26 Feb 2020 04:10:22 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 3D61E181AC9C6 for ; Wed, 26 Feb 2020 09:10:22 +0000 (UTC) X-FDA: 76531707084.21.prose00_20462a471cf37 X-HE-Tag: prose00_20462a471cf37 X-Filterd-Recvd-Size: 3899 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Wed, 26 Feb 2020 09:10:21 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id m16so1935673wrx.11 for ; Wed, 26 Feb 2020 01:10:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=zezVHIKVsEy23WKIqEBxre7fTjr4AovI4tGuQWgev8E=; b=J1pzDT5RYe6QJB/ArnJd0yO1WOMJS10UAqmxuhy04lJL5ATKQo3BAN+5eH2SHPwU/T GeTbcqTU0bFs8F4A5ufZfEVwJYfnfD82f/OqoC2O7Dl1lu7rIUOXmIumj01Ld3a6jEvP VsH0evJvN0xBoZoYdq7H44PuTWalTqnmymRprOxCHbQvT4LKKG4bZw/B9xEgwMw8/iu7 KWdqEdjvzUeO5fRRg0ofHWBeAs413AobZA6nuRFvz/UJYeV9qHS8tiajWvyTKer/1eTl a6R60+4L/2uOgwxCNgzW5md5cCQ9nmZykLXMFe5DLJk6Br/uv6LQn/MLK8h6dz5i+yR/ BPiQ== X-Gm-Message-State: APjAAAV6SYfN6zGiDs9j7JLUZYfpzkQ3STkZJm9wwDLIpQA8XDUD0fp4 Reo1eK/T9zxk46w3bPnDnjo= X-Google-Smtp-Source: APXvYqw/czrxlpJt+0m/pwY5+5eu0JP3G4Ay0V1rlzLaOX87KhdbgdFeZv7KVTjsnC0eFISKxrILng== X-Received: by 2002:adf:dfcc:: with SMTP id q12mr4235815wrn.171.1582708220424; Wed, 26 Feb 2020 01:10:20 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id x6sm2387649wrr.6.2020.02.26.01.10.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2020 01:10:19 -0800 (PST) Date: Wed, 26 Feb 2020 10:10:18 +0100 From: Michal Hocko To: Baoquan He Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, richardw.yang@linux.intel.com, david@redhat.com, osalvador@suse.de, dan.j.williams@intel.com, rppt@linux.ibm.com, robin.murphy@arm.com Subject: Re: [PATCH v2 4/7] mm/sparse.c: only use subsection map in VMEMMAP case Message-ID: <20200226091018.GD3771@dhcp22.suse.cz> References: <20200220043316.19668-1-bhe@redhat.com> <20200220043316.19668-5-bhe@redhat.com> <20200225095713.GL22443@dhcp22.suse.cz> <20200226035336.GF24216@MiWiFi-R3L-srv> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200226035336.GF24216@MiWiFi-R3L-srv> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed 26-02-20 11:53:36, Baoquan He wrote: > On 02/25/20 at 10:57am, Michal Hocko wrote: > > On Thu 20-02-20 12:33:13, Baoquan He wrote: > > > Currently, subsection map is used when SPARSEMEM is enabled, including > > > VMEMMAP case and !VMEMMAP case. However, subsection hotplug is not > > > supported at all in SPARSEMEM|!VMEMMAP case, subsection map is unnecessary > > > and misleading. Let's adjust code to only allow subsection map being > > > used in VMEMMAP case. > > > > This really needs more explanation I believe. What exactly happens if > > somebody tries to hotremove a part of the section with !VMEMMAP? I can > > see that clear_subsection_map returns 0 but that is not an error code. > > Besides that section_deactivate doesn't propagate the error upwards. > > /me stares into the code > > > > OK, I can see it now. It is relying on check_pfn_span to use the proper > > subsection granularity. This really begs for a comment in the code > > somewhere. > > Yes, check_pfn_span() guards it. People have no way to hot add/remove > on non-section aligned block with !VMEMMAP. > > I have added extra comment to above section_activate() to note this, > please check patch 5/7. Let me see how to add words to reflect the > check_pfn_span() guard thing. An explicit note about check_pfn_span gating the proper alignement and sizing sounds sufficient to me. -- Michal Hocko SUSE Labs