From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C797168 for ; Wed, 12 Jan 2022 19:14:51 +0000 (UTC) Received: by mail-lf1-f42.google.com with SMTP id k21so11794997lfu.0 for ; Wed, 12 Jan 2022 11:14:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=igVDWcMipF0SatFt9p6gNS2Y828EjA5ZzPFbjDN4w8s=; b=ZWWedQq2A4EN9KB+CRMjVwqfQ/K1up/vwGXDtcnByaN/WoonWF25/SCIWCrjK8xz0Y 7H+uXrxtCbFyEOSIwciKYoUEevYu3KPy/M+dg8KmzPfA2wRC+EEo3MN80sRDsYvl8ya1 ayoOP76A/t9AtPZaVOvMfMDuup94Fut3p2jGJ5oP3MJwEa5PCOq/an+JBZF+Mkn1D3Ro 08JO/UCPXrBhBQzGpzSRc+c9BSEJpkiKcltxVeaWdFl5HHcYQqrKQTs1TYes7jjmAfc4 eQkwiuP6dhERXlBcyWQYTEjwwxfmz1tPsTpTsCu2+mI4Hymn+wBWE/muNjkbJpjIyhIx tu8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=igVDWcMipF0SatFt9p6gNS2Y828EjA5ZzPFbjDN4w8s=; b=Jz9tk1vBLYWR01L7U+q0KoAFrdDfcQvuiZdBWr31eYYodzbMvNqaz2Hx09I932dnBe q1RvVe3xjRzTK1kIjHw9DTsTrtjJggNrxsdvKV7Z6R/Y+4ZjUmz/pfaPWyl/YSh7bUwL Gg77KtGl2xNNdKNxYYrnTQ8jWygKbbNoJbiC4J9JuBUBNRi4khiojTpwnx/fdLPHV/VE vpCZrYH0/liz2ES669FQ5ynBmvdftYrUQrblZ0fidZu2h6bjBPqe6tG0KbgNtwFiT+vn Ktnwi+xvcufjR1/OhDkfGVdKGO94QCGB4Log8kNr4sNhyhtx+TLWPsylXdVZrOX5hUbr e6cg== X-Gm-Message-State: AOAM530t1vkMS4U+qFNScJ5HAv3Z5Rz6nH7SP6iEHBr51O5p8Q/e5D4p wvkjuCaVwunOJ1I5i2e4EE8GBg== X-Google-Smtp-Source: ABdhPJzlfxAT+7HQhcd4fAWklADHKI95H3h5K1MM3L4iC2TQORXo0ZIlDg8+0aydimE2hYeywaPhYA== X-Received: by 2002:a2e:b791:: with SMTP id n17mr622707ljo.307.1642014889495; Wed, 12 Jan 2022 11:14:49 -0800 (PST) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id p17sm67328lfu.233.2022.01.12.11.14.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 11:14:47 -0800 (PST) Received: by box.localdomain (Postfix, from userid 1000) id E8448103A6D; Wed, 12 Jan 2022 22:15:10 +0300 (+03) Date: Wed, 12 Jan 2022 22:15:10 +0300 From: "Kirill A. Shutemov" To: David Hildenbrand Cc: Dave Hansen , "Kirill A. Shutemov" , Borislav Petkov , Andy Lutomirski , Sean Christopherson , Andrew Morton , Joerg Roedel , Ard Biesheuvel , Andi Kleen , Kuppuswamy Sathyanarayanan , David Rientjes , Vlastimil Babka , Tom Lendacky , Thomas Gleixner , Peter Zijlstra , Paolo Bonzini , Ingo Molnar , Varad Gautam , Dario Faggioli , x86@kernel.org, linux-mm@kvack.org, linux-coco@lists.linux.dev, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv2 1/7] mm: Add support for unaccepted memory Message-ID: <20220112191510.6uqdflbreuet7bnx@box.shutemov.name> References: <20220111113314.27173-1-kirill.shutemov@linux.intel.com> <20220111113314.27173-2-kirill.shutemov@linux.intel.com> <3a68fabd-eaff-2164-5609-3a71fd4a7257@intel.com> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Jan 12, 2022 at 12:31:10PM +0100, David Hildenbrand wrote: > > > > > Looking at stuff like this, I can't help but think that a: > > > > #define PageOffline PageUnaccepted > > > > and some other renaming would be a fine idea. I get that the Offline > > bit can be reused, but I'm not sure that the "Offline" *naming* should > > be reused. What you're doing here is logically distinct from existing > > offlining. > > Yes, or using a new pagetype bit to make the distinction clearer. > Especially the function names like maybe_set_page_offline() et. Al are > confusing IMHO. They are all about accepting unaccepted memory ... and > should express that. "Unaccepted" is UEFI treminology and I'm not sure we want to expose core-mm to it. Power/S390/ARM may have a different name for the same concept. Offline/online is neutral terminology, familiar to MM developers. What if I change accept->online in function names and document the meaning properly? > I assume PageOffline() will be set only on the first sub-page of a > high-order PageBuddy() page, correct? > > Then we'll have to monitor all PageOffline() users such that they can > actually deal with PageBuddy() pages spanning *multiple* base pages for > a PageBuddy() page. For now it's clear that if a page is PageOffline(), > it cannot be PageBuddy() and cannot span more than one base page. > E.g., fs/proc/kcore.c:read_kcore() assumes that PageOffline() is set on > individual base pages. Right, pages that offline from hotplug POV are never on page allocator's free lists, so it cannot ever step on them. -- Kirill A. Shutemov