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 61EB8C25B08 for ; Fri, 5 Aug 2022 14:53:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 95CBD8E0002; Fri, 5 Aug 2022 10:53:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 90BFF8E0001; Fri, 5 Aug 2022 10:53:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7AD1C8E0002; Fri, 5 Aug 2022 10:53:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 674C18E0001 for ; Fri, 5 Aug 2022 10:53:54 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 390101A18F6 for ; Fri, 5 Aug 2022 14:53:54 +0000 (UTC) X-FDA: 79765833588.13.AC6F00A Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by imf08.hostedemail.com (Postfix) with ESMTP id 4B153160047 for ; Fri, 5 Aug 2022 14:53:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659711230; x=1691247230; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=cW59A0boZIrZcRLHW5J56RfVnKU27mehgVJoXc75M14=; b=Hh8j6BRH5BbzfHCmremKt5r6CKoWMtI35GB60Pa00pzHatxCfeyQyLrm 4pz04NjpZK816gKhEDJtDYXVNqCAkVv1vu709nv06tmDkS2HAicRDlLfd 8ga3A7DpQaSHYPJz5hlmHyKROq5PAS7mSHMiH7NYNywakAWn4EAwtod4O 9wXL4o0GCvqlADSaJBpCERdIkPtTJSw3VDduJF7o+Q/ECmuJVfXlLTy0u x+9OEIafg5vEulYV3f6fNSluWr6dgFNu19pbqwEcnOjbFuEEXiQ0N+cpQ CdQcG1SSFcNLJYpPQOI8wxnuTDOzx9VxRwp+1AKzXYUZcasVhWhgDFomQ w==; X-IronPort-AV: E=McAfee;i="6400,9594,10430"; a="316107808" X-IronPort-AV: E=Sophos;i="5.93,216,1654585200"; d="scan'208";a="316107808" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1659711233; a=rsa-sha256; cv=none; b=xO5LMmy5YVFeyWhcdXRmeZgiXDdJqams5l+jkVeboOpyhYSERx2lUC/HVUP0YtLhO/3li9 E/rBAs4QTu6MXwKrtJlX2P16pkOIblUfyjOXt8Oe/R1Ez2B9W3jEi4ytvs2/cwM7wL6nfC SRAM6728aq4OGlvobC8k/+M6lOPMAi0= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=Hh8j6BRH; spf=pass (imf08.hostedemail.com: domain of dave.hansen@intel.com designates 192.55.52.88 as permitted sender) smtp.mailfrom=dave.hansen@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659711233; h=from:from:sender: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:dkim-signature; bh=XDn/iFzaGXJwju9rUUCeSDcCrp38QuPPRjHFsszBsiM=; b=Xn8q/XDR68zb+pXjf3hH+oA4DebZkkCuiojMvDTV0Dlh5nVoRDXTFLE/QkfP6DNijYTzcM HkrFRLfTbrqC4lS6WEq6N1/8tdaN+DwPrge+c4rlDFQsG8SQAWotdC9f+Li1o1tHm5fc/8 7MwTbbc3uaeFx4JmTDwHspi7o29hd2U= X-Rspamd-Server: rspam04 X-Stat-Signature: kj8rtd98batpe6a3sk3h8j84rjbyxaju Authentication-Results: imf08.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=Hh8j6BRH; spf=pass (imf08.hostedemail.com: domain of dave.hansen@intel.com designates 192.55.52.88 as permitted sender) smtp.mailfrom=dave.hansen@intel.com; dmarc=pass (policy=none) header.from=intel.com X-Rspamd-Queue-Id: 4B153160047 X-Rspam-User: X-HE-Tag: 1659711229-435202 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: 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.