Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4642319iob; Sun, 8 May 2022 20:19:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwu3ZOggqZScSRY/pEzl21WdtTEclYXFVB9vYEh6QoDtmaHEYStO6+PNM63X6SLqqlTyTS4 X-Received: by 2002:a62:cf02:0:b0:50d:3e00:60c with SMTP id b2-20020a62cf02000000b0050d3e00060cmr13891448pfg.69.1652066359739; Sun, 08 May 2022 20:19:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652066359; cv=none; d=google.com; s=arc-20160816; b=U7g4a/RH7nssFTo/GU5hS4ANpxZNEa7Idm1cVgExHdaTtfk9rXWSBfgZFQ07CGHplg 95MZsWv7PGIQ6HdgzhbzmIsiH9I5hb+T7s/KCJWzs5DAjOXC/2Cm2ucaf1xe7K1Bf5BV veC5MUt2gsZZG5+VNDZus/w1CRPV3OeTgKoNcDRxPz5Z72pyn5wksH2uCPQ0Z67raq/h bw0kluGO17qHiefA44RblZksN30l5kAZG/jbeqFzdoUmjQtyb1yXnPgxBYnKgWOQj2+X 3Pll3kn7hK/0vjOuV8l0FvrBCA8K6ezNFofQzqFMdSkf+TZcuSjGHhHV9tgBVjJ1PFNb Fvhw== 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; bh=C5GPnJUVP3BtQbsY0hrSBcmaxNZOUF97hX/9OQsx+nA=; b=ACo1gwUQILQ//WZZPEFg/yKuDLaAtKZbbagksnPk0YmtHJvg8PaKUB0FdH5naOJvj+ 1vakF2lziTAv3xHtn9ksEfyjP0np/je//vsVjagrteCH3Deb7Nhp7BqMFcw4CM0pJOdR lZQ/btdwMmpdp9PHYAeevZgHctdx8XNmqHkbTmP9gSUHkKnxDa15AMi+INjaW9R23dRb 3pYTa7xVrtIUwC2yBaOAsb550ahiNPr6ZhBzlXe1kn5xKWt5whJEk/98Y+JpCzlBtyIb zcwrFuLkDxW1OfAoCwNWUwyarBeF5EzdTvfqsU0RgcaeUaBvg/GAmrVtVj5st0ilLPqr ISEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20210112.gappssmtp.com header.s=20210112 header.b=nLZPkQ5P; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id s15-20020a170902ea0f00b0015e8b1857c0si12558443plg.250.2022.05.08.20.19.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 20:19:19 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@shutemov-name.20210112.gappssmtp.com header.s=20210112 header.b=nLZPkQ5P; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A4E7C95A1F; Sun, 8 May 2022 20:19:02 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387722AbiEFA5C (ORCPT + 99 others); Thu, 5 May 2022 20:57:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1387707AbiEFA44 (ORCPT ); Thu, 5 May 2022 20:56:56 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 826FD5E179 for ; Thu, 5 May 2022 17:53:15 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id j4so10140033lfh.8 for ; Thu, 05 May 2022 17:53:15 -0700 (PDT) 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=C5GPnJUVP3BtQbsY0hrSBcmaxNZOUF97hX/9OQsx+nA=; b=nLZPkQ5PVl8ydEQfOubz8On/1Fq63lQN6lh/vZ5Aegg+xPA34KIVO26IrV87jX5wPe 8M10ylUu9YV8TQM8HP2/8undJLvbVcL1/dVTkVcECHb9CzEEqKq07m14/HgnXxA7Njia YFD9HYkWHYF6sWGhtvKCPmH/IStLKZu+wd185XNNJDESn6HYZEa+2g+/xT6nMw6+t8/g 39BKxahY18nOyAdMZrhMfCYQLCIMFGLV4qB/FupV+3jv+iDHAqrfEb52qkY/VpnQPsI8 KTvsIBhr+lDuXx6BCqyiYijMMAKSx6DWRCL3X9YV0fdlAgTdw+PmU7XeCeBdqNxsFuvW hzmg== 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=C5GPnJUVP3BtQbsY0hrSBcmaxNZOUF97hX/9OQsx+nA=; b=KEOR1/FEKvQFHWnTdDDEa9txPxFJoaIZ0+l9rGuPDpX3uVfXXKPuVDU5rYPtBuE2Qs SApVBzyCkiBzADS51k2Ur2rbO21a++e1g8PTcFt9Cr98KqGldPgiOk6DzsJkJd1xg0Z1 cstFgomMx7qYOtPCTQPtXqY1BWRQhYcqgUOUF9vHFgPBsma8quB3lTWYEQvm0HS5P3Ex 8Czj6xPPF2UnWEZ3Q96RBvcV1qYPi8w3ebxHUlpxX4mA1C85SX8onYEhjZ5F5UsF7Q7K 6qktsORguLTrjdMX7mWfWC0INq3XcgklUzAE5SLcDyg9OxImsZ/PA9zcQIqsUN8/BUJB Lz8w== X-Gm-Message-State: AOAM5337jQ/r5b2Tg6xnqTsb7ERZWGTLf2/Gru/yDTs1vc1S95ohtj3i hZTghTb3J/nMg6t2cNpaSOmUTQ== X-Received: by 2002:a05:6512:3b87:b0:473:9e36:5f0d with SMTP id g7-20020a0565123b8700b004739e365f0dmr715960lfv.424.1651798393878; Thu, 05 May 2022 17:53:13 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id c33-20020a05651223a100b0047255d21113sm443339lfv.66.2022.05.05.17.53.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 May 2022 17:53:13 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id A1C92104AF0; Fri, 6 May 2022 03:54:58 +0300 (+03) Date: Fri, 6 May 2022 03:54:58 +0300 From: "Kirill A. Shutemov" To: David Hildenbrand Cc: "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 , Dave Hansen , Brijesh Singh , Mike Rapoport , x86@kernel.org, linux-mm@kvack.org, linux-coco@lists.linux.dev, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Mike Rapoport Subject: Re: [PATCHv5 02/12] mm: Add support for unaccepted memory Message-ID: <20220506005458.jrebaho2w55ojwyb@box.shutemov.name> References: <20220425033934.68551-1-kirill.shutemov@linux.intel.com> <20220425033934.68551-3-kirill.shutemov@linux.intel.com> <2bb92a84-18f4-d007-9465-fdc19f6f1c86@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2bb92a84-18f4-d007-9465-fdc19f6f1c86@redhat.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Tue, May 03, 2022 at 10:21:03PM +0200, David Hildenbrand wrote: > > > > > +/* > > + * Page acceptance can be very slow. Do not call under critical locks. > > + */ > > +static void accept_page(struct page *page, unsigned int order) > > +{ > > + phys_addr_t start = page_to_phys(page); > > + int i; > > + > > + accept_memory(start, start + (PAGE_SIZE << order)); > > + > > + for (i = 0; i < (1 << order); i++) { > > + if (PageUnaccepted(page + i)) > > + __ClearPageUnaccepted(page + i); > > + } > > +} > > What was the rationale of leaving PageUnaccepted() set on sub-pages when > merging pages? > > I'd just clear the flag when merging and avoid the loop here. You could > even assert here that we don't have any PageUnaccepted() on tail pages. Okay, fair enough. I will change the code. -- Kirill A. Shutemov