Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1058316rwd; Wed, 31 May 2023 08:58:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6rofR/jCVWpg/jPsa0tbK5vO13dwLQuMgWx+FCjpzYPUrJZo/8RB9gHzHc7/yVNyMw/+l3 X-Received: by 2002:a17:90a:a2b:b0:256:675c:e552 with SMTP id o40-20020a17090a0a2b00b00256675ce552mr4831670pjo.13.1685548709401; Wed, 31 May 2023 08:58:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685548709; cv=none; d=google.com; s=arc-20160816; b=ce+7p4UJWg5QULJj+kzMn0WX/EfOuy+U1PiBMYCryz6misaDheaBUXq672xKkUVTM3 9wYkjzZz4zd6cgXD+8krGT8FYsA9LY3qergddVSb7J6yO61TjBNg9EM7YGt/UQPP+CX2 YQvdZD30EfmM9Ui5DX/YL+0aEd1/nny/dA/SapIbMIlwh2HC7XFObq7zNq6FF9wCwx7R kJyRhWj2EXV37+9oUa2fDwHjosbaK16zIB24b9Mw7mBKLrO5EhVMTM4t9keM0s/nRW3m QxNu9paBxw66zveA+7E95SxXyNtncFmS+mAWK3+AcwUTWiRfJDP/gbzjPTJDa6ShzgU3 Fzpg== 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=PjJvC25aHbGALiU6YVgnG9fmUYnvsHAivYjN1VpUWL8=; b=rcZniNBBwnWuj9CiMmho1njMp/RrHlpPPf2TPF5BTtPltMrrH190gR/KEy8ISr9gsa EBEpblT36JRpQi+OUR1SidnFavQFSogVwCV65QyZ1MZM9hX1HDFf2eKXL2yWH6rDL98p xQ1/iJ5mXM5Q/t9HDQycxU5urZyi4ZRh096CUPA/Kap8l1EIspn6UZBRDsv2aBwvtW0h wi/R9wsstMl8/2MVgODKNzgP+oIi2ZISe9+YW0fnLyQ+W4h7fKucKmCXQqg7qNhmLkHP YdOcIoVLziuZh6x08jZkIs+M2HGTMKoYOPYWumc8RTlTfQAQY9tiR0Wo8ydCSzdq565g tW8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@alien8.de header.s=dkim header.b=hTxgDwfu; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l1-20020a17090a850100b0025346cf794dsi1147573pjn.134.2023.05.31.08.58.15; Wed, 31 May 2023 08:58:29 -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=temperror (no key for signature) header.i=@alien8.de header.s=dkim header.b=hTxgDwfu; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234104AbjEaPwK (ORCPT + 99 others); Wed, 31 May 2023 11:52:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231640AbjEaPwJ (ORCPT ); Wed, 31 May 2023 11:52:09 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D81E8E; Wed, 31 May 2023 08:52:08 -0700 (PDT) Received: from zn.tnic (pd9530d32.dip0.t-ipconnect.de [217.83.13.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 9C3121EC042D; Wed, 31 May 2023 17:52:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1685548326; 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:in-reply-to:in-reply-to: references:references; bh=PjJvC25aHbGALiU6YVgnG9fmUYnvsHAivYjN1VpUWL8=; b=hTxgDwfuCwzRv4XyrSuZ1Qa/JoBjVnYer95z1d/ZhV90LaqH0lo9D/xw19UMf4qna+zqJN PLvs3Zyviep3I4zsBKo5jRh/OzsXXIobNdM1eoy13WyxhPFbpuCfTfMj9xCgpxQJMzYNj2 PFcu9weh1qnAloA4dGUNGjjHbMOIB2E= Date: Wed, 31 May 2023 17:51:59 +0200 From: Borislav Petkov To: "Kirill A. Shutemov" Cc: Andy Lutomirski , Dave Hansen , 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 , Dario Faggioli , Mike Rapoport , David Hildenbrand , Mel Gorman , marcelo.cerri@canonical.com, tim.gardner@canonical.com, khalid.elmously@canonical.com, philip.cox@canonical.com, aarcange@redhat.com, peterx@redhat.com, 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: [PATCHv12 1/9] mm: Add support for unaccepted memory Message-ID: <20230531155159.GIZHdtH20Q0FsmN3OR@fat_crate.local> References: <20230518231434.26080-1-kirill.shutemov@linux.intel.com> <20230518231434.26080-2-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230518231434.26080-2-kirill.shutemov@linux.intel.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Fri, May 19, 2023 at 02:14:26AM +0300, Kirill A. Shutemov wrote: > The patch implements #1 and #2 for now. #2 is the default. Some s/This patch implements/Implement/ > workloads may want to use #1 with accept_memory=eager in kernel > command line. #3 can be implemented later based on user's demands. All this remaining text should not talk about what is being done - that's in the diff - but why. Drop the "what" pls. > Support of unaccepted memory requires a few changes in core-mm code: > > - memblock has to accept memory on allocation; > > - page allocator has to accept memory on the first allocation of the > page; > > Memblock change is trivial. > > The page allocator is modified to accept pages. New memory gets accepted > before putting pages on free lists. It is done lazily: only accept new > pages when we run out of already accepted memory. The memory gets > accepted until the high watermark is reached. > > EFI code will provide two helpers if the platform supports unaccepted > memory: > > - accept_memory() makes a range of physical addresses accepted. > > - range_contains_unaccepted_memory() checks anything within the range > of physical addresses requires acceptance. > > Signed-off-by: Kirill A. Shutemov > Acked-by: Mike Rapoport # memblock > Reviewed-by: Vlastimil Babka > --- > drivers/base/node.c | 7 ++ > fs/proc/meminfo.c | 5 ++ > include/linux/mm.h | 19 +++++ > include/linux/mmzone.h | 8 ++ > mm/memblock.c | 9 +++ > mm/mm_init.c | 7 ++ > mm/page_alloc.c | 173 +++++++++++++++++++++++++++++++++++++++++ > mm/vmstat.c | 3 + > 8 files changed, 231 insertions(+) Diff itself looks ok. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette