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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EC1BC433F5 for ; Tue, 3 May 2022 20:21:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 745736B0072; Tue, 3 May 2022 16:21:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6F3BC6B0073; Tue, 3 May 2022 16:21:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5BB5E6B0074; Tue, 3 May 2022 16:21:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 4976F6B0072 for ; Tue, 3 May 2022 16:21:51 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 1CA23295E1 for ; Tue, 3 May 2022 20:21:51 +0000 (UTC) X-FDA: 79425552822.10.88E6258 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf15.hostedemail.com (Postfix) with ESMTP id 3D157A007E for ; Tue, 3 May 2022 20:21:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651609310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XuOARFW3gYZOmM4Y4nSXFBD8lHm6BchzW975izB6OwE=; b=HNOxRwKVYwlg04yKotWgvKeWVQOEB05eOHd0elNZOu+eXAyxJRzeekapoguWZ9HIBDAZja RYOjqKKem0oDnGsPFIyEML1iK80mmtg/Z74gNsDg67CU2+xfzB2sNKFgkrms5T3Dn9tLkX sroH1tHnVBQGzJ8enxxf45dDgFo5hxY= Received: from mail-oo1-f70.google.com (mail-oo1-f70.google.com [209.85.161.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-144-UIUuJss7P3uXO0xKeRzlrg-1; Tue, 03 May 2022 16:21:08 -0400 X-MC-Unique: UIUuJss7P3uXO0xKeRzlrg-1 Received: by mail-oo1-f70.google.com with SMTP id y3-20020a4ac403000000b0035ebcf8d39dso6959529oop.21 for ; Tue, 03 May 2022 13:21:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=XuOARFW3gYZOmM4Y4nSXFBD8lHm6BchzW975izB6OwE=; b=QoUZtwb18dAI2kRQANsnQWE0N+/FlgVNkR1L80uxiDVq6yT5zqBqOGu0YBP539dHgx IPd+tuVuZ+wYBamLH82fE+XCLPuyvtuIJS7y7thDKGV18lTjalU1rZL2nMMmOhqnVnUz 2m+lh5ucbiYrZX8ubmS76yRAFtTSat+R2AgUo83sbDbhCOZ4vqYIaI6eVDJTPDmiispm 99XgXLHXIW/5yvx1t2E5S+K9oSP66HyBIRws9wmQqdy1mNhLxfQ0vDm+Q8wtb73iXLAC l9JbzTODmXBbMyVcQB7CZoL+QIJ28oRAnBrja0Zdd5Ebc/Y3xOlFfMxlF3nf/Zc027Qs 6GwQ== X-Gm-Message-State: AOAM530QwbtSw0cCEZcdhqKvyN0LJQIQ3XFpmBgohESurfEu2k9N3OBA ftrps75S1ez7h37bFtYBf8d5CdjUnijqt/aJSQhLp0YTBeaO3t0YkS9nqFFLPgHlt39RKCc/zwf Bk0n2K4dsUh4= X-Received: by 2002:a05:6808:14d3:b0:325:ed6b:e748 with SMTP id f19-20020a05680814d300b00325ed6be748mr2683320oiw.105.1651609267928; Tue, 03 May 2022 13:21:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKRbb5OLkMV2UmDQ1VLpoVhTPJwDt2cIVnFXrIsYyzxEIudxX/SPJKn8BJ62U+FH4qM5Vz5Q== X-Received: by 2002:a05:6808:14d3:b0:325:ed6b:e748 with SMTP id f19-20020a05680814d300b00325ed6be748mr2683301oiw.105.1651609267392; Tue, 03 May 2022 13:21:07 -0700 (PDT) Received: from [10.10.69.234] ([8.34.116.185]) by smtp.gmail.com with ESMTPSA id w11-20020a4adecb000000b0035eb4e5a6cesm5328939oou.36.2022.05.03.13.21.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 May 2022 13:21:06 -0700 (PDT) Message-ID: <2bb92a84-18f4-d007-9465-fdc19f6f1c86@redhat.com> Date: Tue, 3 May 2022 22:21:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCHv5 02/12] mm: Add support for unaccepted memory To: "Kirill A. Shutemov" , Borislav Petkov , Andy Lutomirski , Sean Christopherson , Andrew Morton , Joerg Roedel , Ard Biesheuvel Cc: 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 References: <20220425033934.68551-1-kirill.shutemov@linux.intel.com> <20220425033934.68551-3-kirill.shutemov@linux.intel.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20220425033934.68551-3-kirill.shutemov@linux.intel.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 3D157A007E X-Stat-Signature: e4hnr7tgu4xk73iw8jmsaawzuwn4rbf3 X-Rspam-User: Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=HNOxRwKV; spf=none (imf15.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1651609302-326885 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: > > +/* > + * 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. -- Thanks, David / dhildenb