Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2664924iog; Mon, 20 Jun 2022 01:53:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vexAxwQJACBhWnvcS3UPORo57cD1xUeJ6V1itxnWkQLahF1/RiIxFVGXu8yOWLAeS8zpFa X-Received: by 2002:a05:6402:2714:b0:431:6a31:6530 with SMTP id y20-20020a056402271400b004316a316530mr28298612edd.245.1655715184478; Mon, 20 Jun 2022 01:53:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655715184; cv=none; d=google.com; s=arc-20160816; b=e3YbZF4NP+/8VcEwF71aSaV5fS/8PKbNvYBwDbXxWqiPjjDmHPV/dt6EONgPZl5U8K kuLb4kAFdd3yKlGUX1TgFntdIbpAuuBg7D39XxmCQmN3xrjomTVQ/jLuTOC30UQAodYk x+Cb+S/2Cf36865XhJZgDE81raxygZ/qXjp3KzHnOyRDovNYrnEf996LsLLiELKXl5cF 4FkjN1VLBlUgVbgvG5vIVtKAByOvpMmsF+nyBMLzDsQfx8/0nn5CClShWryvA3EAfQ+f RhSii8VnXP/1jl+DWln4ISR4v5qBsb/tXrTQtcluUnDzhkCZv0bTds709TNeFlna1IEl Fvsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=mMXO29bS5Q5WlYmqVACMoUiiETrgWHmM6SWuoP7+kKk=; b=Z+Z3kOPZDp18kS5J+GkC0y6CA/2JnGeYlL+Ckd/aihmzrgI1O1gwE5qDrvfW+/vY/x 87Z+w+H/o8OFvGufvY14sqWb2mcGucXay9qapZos/YDiWfL+qUCZVNki1+z1Po5XfUHV MVlJF9gpvmK5TiCjn63fZg723pdGiY4FvFgm3qdAjhJw592l5svuolByXYeEayMkEIzM /f1W5Otijn+oWYNbEEo3voPSIEOPdfoTBUYYblwwiFSKl0Xax2y596CgSNJAoKnphJj4 A9VzTohZosujcp2itE7M7Id4gGSiGZg5DZVMtVToAbtbi+Jbf16e6e4ncpi5srtsqfON lN9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=lP9zx3xP; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bx13-20020a0564020b4d00b0043574fb5ca5si5201508edb.266.2022.06.20.01.52.37; Mon, 20 Jun 2022 01:53:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=lP9zx3xP; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240122AbiFTIoq (ORCPT + 99 others); Mon, 20 Jun 2022 04:44:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239062AbiFTIop (ORCPT ); Mon, 20 Jun 2022 04:44:45 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24C31E9A; Mon, 20 Jun 2022 01:44:44 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id D5CFC1F383; Mon, 20 Jun 2022 08:44:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1655714682; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=mMXO29bS5Q5WlYmqVACMoUiiETrgWHmM6SWuoP7+kKk=; b=lP9zx3xPKJLxlJpBtp1BMFWIfqYN19uwvucIIYapP9tnNRt001tMLdLVdX5Auq/B7OpdNK ICULE3T252YKMFmyGXMaiBHQu0D+Y3wbC8hgjCjiuKFLfO+ysv3XMJJdGlyQRk5CmGh6z5 IheflEFXNcTl67Nohect5VcFvKupEV0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1655714682; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=mMXO29bS5Q5WlYmqVACMoUiiETrgWHmM6SWuoP7+kKk=; b=OXh9d08JY4cPZuhYh4bghTRS6B4Iaz6hpajRV8YXITxOpgsVKp5mBAdN5nBqdtYrSM3eP2 Ms1Tw9nvVP1aWLAw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3796313638; Mon, 20 Jun 2022 08:44:42 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 7mreCnozsGLQLAAAMHmgww (envelope-from ); Mon, 20 Jun 2022 08:44:42 +0000 Date: Mon, 20 Jun 2022 10:44:40 +0200 From: Oscar Salvador To: Muchun Song Cc: David Hildenbrand , akpm@linux-foundation.org, corbet@lwn.net, mike.kravetz@oracle.com, paulmck@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, duanxiongchun@bytedance.com, smuchun@gmail.com Subject: Re: [PATCH v4 2/2] mm: memory_hotplug: make hugetlb_optimize_vmemmap compatible with memmap_on_memory Message-ID: References: <20220619133851.68184-1-songmuchun@bytedance.com> <20220619133851.68184-3-songmuchun@bytedance.com> <226243a9-b4f5-182e-1a5b-7b8d5c28f3b3@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 20, 2022 at 04:29:11PM +0800, Muchun Song wrote: > > > Although it works, I think PageVmemmapSelfHosted() check for the 1st pfn's > > > vmemmap page is not always reliable. Since we reused PG_owner_priv_1 > > > as PG_vmemmap_self_hosted, the test is noly reliable for vmemmap page's > > > vmemmap page. Other non-vmemmap page can be flagged with PG_owner_priv_1. > > > So this check can be false-positive. Maybe the following code snippet is > > > the solution. > > > > How could that happen for pages used for backing a vmemmap? > > > > It cannot happen for memmap_on_memory case. Howwver, it can happen for other > cases. E.g. the 1st pfn (of boot memory block) whose vmemmap page may be flagged > as PG_owner_priv_1 (if PG_swapcache is set). Then, the check is false-positive. If this can really happen, which I am not that sure tbh, maybe a way out would be to just define a new page-type as we did in previous versions of memmap_on_memory. In that way we would not for flags, but for its type. But as I said, I am not entirely sure about the potential fallout of what you mention. -- Oscar Salvador SUSE Labs