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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D23FC00140 for ; Fri, 5 Aug 2022 14:53:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238717AbiHEOxx (ORCPT ); Fri, 5 Aug 2022 10:53:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240425AbiHEOxu (ORCPT ); Fri, 5 Aug 2022 10:53:50 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 797713F30E; Fri, 5 Aug 2022 07:53:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659711229; x=1691247229; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=cW59A0boZIrZcRLHW5J56RfVnKU27mehgVJoXc75M14=; b=CbGtY5Y33/bC213ZXNfdPMhCxYAj3Q3uYNOMSIxgfD+gx+MSeQPPc4+7 UIb3T0Z/0NL4Lx8Z9uWscZgJS2u6+4bkcpcRpRnpjAN6TVYaKI1P2ItnT rOAMfh3qRj5AiNuLpyp04FxUOZpnPlBp2zNdlIE+lD8pLrpUxgUq7OhU0 N+mep48IIVCuTIlPQkaZd5aKAMKR6d4kOcKFOUB44aTOjnboJtzipmUv5 rjy/3fnmXd6jKQGHeOTvL4siOUk9c5gOnXcRExDLAwYAO6g7Vnm+FccLM 5r/eM/F2auzh9YUqA1PQh9CmJJX5gT5cfcm3ioHl3jeQids953QagC5eV w==; X-IronPort-AV: E=McAfee;i="6400,9594,10430"; a="291437687" X-IronPort-AV: E=Sophos;i="5.93,216,1654585200"; d="scan'208";a="291437687" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Aug 2022 07:53:49 -0700 X-IronPort-AV: E=Sophos;i="5.93,216,1654585200"; d="scan'208";a="579521566" Received: from rderber-mobl1.amr.corp.intel.com (HELO [10.212.217.71]) ([10.212.217.71]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Aug 2022 07:53:48 -0700 Message-ID: <6501ea6b-5659-53ee-7ae0-7ad248844086@intel.com> Date: Fri, 5 Aug 2022 07:53:49 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCHv7 02/14] mm: Add support for unaccepted memory Content-Language: en-US To: David Hildenbrand , Vlastimil Babka , "Kirill A. Shutemov" , Borislav Petkov , Andy Lutomirski , Sean Christopherson , Andrew Morton , Joerg Roedel , Ard Biesheuvel Cc: Andi Kleen , Kuppuswamy Sathyanarayanan , David Rientjes , Tom Lendacky , Thomas Gleixner , Peter Zijlstra , Paolo Bonzini , Ingo Molnar , Dario Faggioli , Mike Rapoport , marcelo.cerri@canonical.com, tim.gardner@canonical.com, khalid.elmously@canonical.com, philip.cox@canonical.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 , Mel Gorman References: <20220614120231.48165-1-kirill.shutemov@linux.intel.com> <20220614120231.48165-3-kirill.shutemov@linux.intel.com> <8cf143e7-2b62-1a1e-de84-e3dcc6c027a4@suse.cz> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/5/22 07:22, David Hildenbrand wrote: >> A list that sits besides the existing free_area, contains only >=pageblock >> order sizes of unaccepted pages (no migratetype distinguished) and we tap >> into it approximately before __rmqueue_fallback()? There would be some >> trickery around releasing zone-lock for doing accept_memory(), but should be >> manageable. >> > Just curious, do we have a microbenchmark that is able to reveal the > impact of such code changes before we start worrying? Nope. I went looking to see if I could find any impact. I think Kirill did too. Too bad that effort didn't make it into the changelog yet. The merging check at least is just checking a field in a cache-hot 'struct page'. The common case is probably three instructions: load to a register check the bit jump if not set It adds a wee bit of icache pressure, but it's also the kind of thing that should be a piece of cake for the branch predictors. That dynamic check could easily be wrapped by a static branch. But, that first requires more code to go dig in the nooks and crannies of the page allocator to make sure *ALL* pages are accepted.