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=-2.5 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 DF428CA9EB9 for ; Tue, 22 Oct 2019 08:20:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AC31F20684 for ; Tue, 22 Oct 2019 08:20:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC31F20684 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 3C12B6B0003; Tue, 22 Oct 2019 04:20:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3709A6B0006; Tue, 22 Oct 2019 04:20:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2869B6B0007; Tue, 22 Oct 2019 04:20:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0173.hostedemail.com [216.40.44.173]) by kanga.kvack.org (Postfix) with ESMTP id 014766B0003 for ; Tue, 22 Oct 2019 04:20:56 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 75F61181AF5C3 for ; Tue, 22 Oct 2019 08:20:56 +0000 (UTC) X-FDA: 76070724912.15.meat69_425f0f59c3a18 X-HE-Tag: meat69_425f0f59c3a18 X-Filterd-Recvd-Size: 3910 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Tue, 22 Oct 2019 08:20:55 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 61DF4ADFE; Tue, 22 Oct 2019 08:20:54 +0000 (UTC) Date: Tue, 22 Oct 2019 10:20:53 +0200 From: Michal Hocko To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Vlastimil Babka , Oscar Salvador , Mel Gorman , Mike Rapoport , Dan Williams , Wei Yang , Alexander Duyck , Anshuman Khandual , Pavel Tatashin Subject: Re: [PATCH v1 1/2] mm/page_alloc.c: Don't set pages PageReserved() when offlining Message-ID: <20191022082053.GB9379@dhcp22.suse.cz> References: <20191021141927.10252-1-david@redhat.com> <20191021141927.10252-2-david@redhat.com> <20191021144345.GT9379@dhcp22.suse.cz> <20191021154712.GW9379@dhcp22.suse.cz> <91ecb9b7-4271-a3a7-2342-b0afd4c41606@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <91ecb9b7-4271-a3a7-2342-b0afd4c41606@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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 Mon 21-10-19 17:54:35, David Hildenbrand wrote: > On 21.10.19 17:47, Michal Hocko wrote: > > On Mon 21-10-19 17:39:36, David Hildenbrand wrote: > > > On 21.10.19 16:43, Michal Hocko wrote: > > [...] > > > > We still set PageReserved before onlining pages and that one should be > > > > good to go as well (memmap_init_zone). > > > > Thanks! > > > > > > memmap_init_zone() is called when onlining memory. There, set all pages to > > > reserved right now (on context == MEMMAP_HOTPLUG). We clear PG_reserved when > > > onlining a page to the buddy (e.g., generic_online_page). If we would online > > > a memory block with holes, we would want to keep all such pages > > > (!pfn_valid()) set to reserved. Also, there might be other side effects. > > > > Isn't it sufficient to have those pages in a poisoned state? They are > > not onlined so their state is basically undefined anyway. I do not see > > how PageReserved makes this any better. > > It is what people have been using for a long time. Memory hole -> > PG_reserved. The memmap is valid, but people want to tell "this here is > crap, don't look at it". The page is poisoned, right? If yes then setting the reserved bit doesn't make any sense. > > Also is the hole inside a hotplugable memory something we really have to > > care about. Has anybody actually seen a platform to require that? > > That's what I was asking. I can see "support" for this was added basically > right from the beginning. I'd say we rip that out and cleanup/simplify. I am > not aware of a platform that requires this. Especially, memory holes on > DIMMs (detected during boot) seem like an unlikely thing. The thing is that the hotplug development shows ad-hoc decisions throughout the code. It is even worse that it is hard to guess whether some hludges are a result of a careful design or ad-hoc trial and failure approach on setups that never were production. Building on top of that be preserving hacks is not going to improve the situation. So I am perfectly fine to focus on making the most straightforward setups work reliably. Even when there is a risk of breaking some odd setups. We can fix them up later but we would have at least a specific example and document it. -- Michal Hocko SUSE Labs