Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp514068iob; Wed, 4 May 2022 01:45:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+pSlUf/KCpOuX2L7kj2IhEm4DItJ1BiGLc9kaq4AGxG+cezLFkm8yLCKRT8Xlvi48KWi4 X-Received: by 2002:a05:6a00:a02:b0:4fd:f9dd:5494 with SMTP id p2-20020a056a000a0200b004fdf9dd5494mr20310178pfh.68.1651653914344; Wed, 04 May 2022 01:45:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651653914; cv=none; d=google.com; s=arc-20160816; b=jH/eScyZ9o4TR8/RvFaaXcyu0+AEns2lcBhKnSMlCZj07zGs1FGHh9Wo0pV4vA2Jtp BAn61ADu6jACCpaV9ga1Igz7uJ01bF1UIi5PAl3LYPlAfILi02Io6Cq8dIAAr6rqkJt+ 3Np6ekUB7IThCdkddQjxqXdhjlKZFYBFhWaHoIxBgSiWIx6TZdBKT3elEe1dsrOK0YQ3 kmWtapNSVLpe1CTru51c05eH76skDeRbtW8iMlkotaIWiEA8CBaJCkkM+C9tQq6NQvDC 9wXwQBbey9sEmuZGrHsuqdJ+R9c8WcU2bsZBEcoH66tOZ4uvBX6HWPQ0pbgQpfeRpmPO rtIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=XuOARFW3gYZOmM4Y4nSXFBD8lHm6BchzW975izB6OwE=; b=NARyM+8jmg08JKUOAgEHFrf9x2nTV27NWuIctxr1RAnctmgus2h+kM6HppVmt3qfV6 t6ojxoqivZnCzJ/zKQMkCaSzjq6TsQqNtFlg9bs3II6qCgvzjJfWidS31fetVPDHl6l9 sLMB+liTDGH+AgDP984hRhtKgpkGnz9KBKlpQxbBsSUpRdXuGnYpPPcJ33scFd5U3HcN 7cbqJnA5OffkOmAb1sl22QZy2+k6ofn6iOJ0c1H9ApKDn08hL4bmt1Z0cSeVLLPOnF2L 1V2qhcNh8hmXkQodsUXy4oWoJ3iz8ChjMaHCxUCMV/yrCXHfm7Beuv/9gJLmyvjsGt0d vYvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iuBRe20h; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 6-20020a630a06000000b003c17fccbabdsi7368139pgk.495.2022.05.04.01.44.58; Wed, 04 May 2022 01:45:14 -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=@redhat.com header.s=mimecast20190719 header.b=iuBRe20h; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243704AbiECWb4 (ORCPT + 99 others); Tue, 3 May 2022 18:31:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235020AbiECWby (ORCPT ); Tue, 3 May 2022 18:31:54 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7A02725C5A for ; Tue, 3 May 2022 15:28:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651616900; 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=iuBRe20hnQHQVQ0swIUR96GUeNQGJnMv7wv9r87aIyy08tnwLb0gWhiH6ScRw6cLfGiTlX ixMtg4sS1gNcl8V6wmaVoEOP4iJO8bbDfjPo0uzq8Z07JuSMTUwbJQadrNcURt/zwFkhYr ugc9Zrea8eiWpeImx666Qk9IyOfa3KQ= Received: from mail-oa1-f72.google.com (mail-oa1-f72.google.com [209.85.160.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-627-jzvhMj81N7y9tKQjdCVuKQ-1; Tue, 03 May 2022 16:21:09 -0400 X-MC-Unique: jzvhMj81N7y9tKQjdCVuKQ-1 Received: by mail-oa1-f72.google.com with SMTP id 586e51a60fabf-e1fa5c533eso6398262fac.19 for ; Tue, 03 May 2022 13:21:09 -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=wtdmET3sB2ox6gIQ/lfvZq/Y5mkOQRZH3N+2zdKkkFrrq6js89hUo6iJ3xlLto5zTY 17/HgCsAAeCS9YPcwEGue5mv56Q5//M5W4uxRlTVOJBW0FkQpHoHV+etgIrp9qJdgMVk V5nRz0rwKToxz6UOK95Awa1GDUc0LpReC6MYLcFXYdSjEQ1w9OF0P15nIAFlA38nTOi9 HCrdeZwJLjfTqhvOoiLdxkdm3pVNZ8Fgc7kMSaPWTz2uYygAyMpsYnowbbvhV/aSvhvn zVw8y7T59dtqZ/l4miLFQl2ukBdn7wCr9sYX4IbSuIjc9+zSt3owvt8jn+AyiEYmAIhS EL7g== X-Gm-Message-State: AOAM532FIK2NE1+gnuuPHx/3jTxo3H2+gCLagQ4T89trf25M6C2D7SBr z0chpbcL3UYe2bL9+8WJim224zQYXZCfVqQK4GgztHfczIGyouBXEPGHT8XQJBLYskAfMYVf6jX vS4iK80cquCcgLa3CCzIoZgsS X-Received: by 2002:a05:6808:14d3:b0:325:ed6b:e748 with SMTP id f19-20020a05680814d300b00325ed6be748mr2683340oiw.105.1651609267936; Tue, 03 May 2022 13:21:07 -0700 (PDT) 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 Content-Language: en-US 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> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 > > +/* > + * 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