From patchwork Fri Mar 15 14:08:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew Wilcox (Oracle)" X-Patchwork-Id: 13593503 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 0E341C54E58 for ; Fri, 15 Mar 2024 14:08:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 48FF88012D; Fri, 15 Mar 2024 10:08:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 43EEB800B4; Fri, 15 Mar 2024 10:08:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 32D998012D; Fri, 15 Mar 2024 10:08:32 -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 2274A800B4 for ; Fri, 15 Mar 2024 10:08:32 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id E1EDF1A1498 for ; Fri, 15 Mar 2024 14:08:31 +0000 (UTC) X-FDA: 81899453622.07.2538277 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf18.hostedemail.com (Postfix) with ESMTP id 5E0581C001B for ; Fri, 15 Mar 2024 14:08:28 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=dzfENeQn; spf=none (imf18.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1710511709; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=dWkp9JuqKXgZd7jk1leFvg1MN0tRcwaXf+bmROYFYZA=; b=fbu9sENo6jSI6mImoXKRfJ65gh4QSqbfFBRLzLV/7Ac/Cg2H2GeuJcEh4O1PGjHr2AcTsx JLQm32aH16yTpIVpr3ZkPFf27J4QNmLQC/Ln2TC+4307UHNn4IbeQ6t1V0UEI/LzTUlmkv 1ndfupmMXiWmhmI7HC/1yKYandYyMCc= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=dzfENeQn; spf=none (imf18.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1710511709; a=rsa-sha256; cv=none; b=6x/YmlV5jZLPkVwlEPAcDEKuxsTIbYNfVxxUWjhp04N/aCb+TxG7wc8Jp7+F6Rhb+WiThX b7lMIE30l0HeVV3cgqhAt1/1XWP0RWezQsXeWYhfUkiDn04xOPa2ecdevUS9o3WkgXi2M3 VOT7tAhqElrw71dq0FR7tZUwVkkuhXw= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=dWkp9JuqKXgZd7jk1leFvg1MN0tRcwaXf+bmROYFYZA=; b=dzfENeQnrP3JRhLhwqMNfDqg8J HuXrPa4L/aEBXIGJMyWc4cyNiFI02s/OtEkFW1U8CFJCe5vTyEfmBMHy7GgO1tswY428mWLDhV7Wu 06YWsA3bCOB8n+Cm1L1cBRcioeaOaGMqjW7E23u9m/5k70jSsnbc6LXqrvYgffrXVP8rLgkzqQPXD q3+M0F4mgqH9CtYf8XG9IxRtpBDos9Ga9Q/MbWYlzecHoSbhxMS67c2Ys9lG7jBHh5444MjUkB3cN bCalrVfNTzo6wKu4G3iG/4Q9IHHR1+BGcUgnSpXDbHNfJXVYzQI7voun2S2Kk0bIiUbrvU7KUaiPF EsskmrFA==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rl8ES-0000000AOgQ-4BYz; Fri, 15 Mar 2024 14:08:25 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Yujie Liu , kernel test robot Subject: [PATCH] mm: Increase folio batch size Date: Fri, 15 Mar 2024 14:08:21 +0000 Message-ID: <20240315140823.2478146-1-willy@infradead.org> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-Rspamd-Queue-Id: 5E0581C001B X-Rspam-User: X-Stat-Signature: z6wqjsqf9fbmojb73849ztztfrnztmri X-Rspamd-Server: rspam01 X-HE-Tag: 1710511708-598666 X-HE-Meta: U2FsdGVkX1/8Sp/+MvCfu3VhGPggcrd6kFpxtx/kE51G4iKzx5jzFCsSJ/6iiWebJROP5rODnEBKzuRIKs4t1Nvfxxh+UNXAAkXgwyUUL7YZHmnrO1v3yDDJTFoxwwZixDHKHYEDb6dn3oOEylKRaFeE6HbP1J2PkPxZp1VH5mq3CUCBAI4IcgEWFxG993kbtKo/OSBx9XGN21+2KdXO7PPwl2LrBhFb1VyCDs0uJ21A/YOzfjn8+Q2XNl/Pr306vfLMLD8AEZBPKuoHEA/bNfsnHLNQsS07vaOJirUYlsjV7vtiA39GSjvZvUpGqrIL14+EfAtBBu+co/I64IkjP+VDp1WeYIpfSHze5fAPzR0PWpZZBgUiYGdux9GdOEUfOM0bBlHCiLIKx/BH9jHm6M33VWLmvRGcGpYQUqoseFDd7f+wGnN5kMF1S0QTgusbiMSZZd6Z3raNFF+NL0TlSxZmQKQu+d0TiDVBAEZU1JOYyQLb27I1ArZijbAVItTwTEOltI7HZ1/hSbHGUTaI+71MYgqJ/i5F2Q6CVcjQYG3ET0UGergGGU2UXW7rAxRpJivx9xKS902X+3T6ROltF/7yW4AaACKuGojPdnpzLfWHKQlMSFk+jogYfiFOnjcwidd9cHn+4MtxRpqJrtw99N41pXR1qJUqTjiEUFNLxr9gcmakVCFr3ujuYvzT6dmIKZuitCsl3+wNmOVMyDv6/kzAm4BzswF6HONklrCg/uWSsBbfism4dZLYRk+6V6F8T6lmh43jmhritEApQ76Ki9kQW5NJqRIfrORtXGDr4LScmYxJO8WVjXvP8DwwLTtz5UL9DzidzCF0j4FYNW6MFenmkkLZiU5X7Dj+JE3jUp86Sux6BNfpQg== 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: List-Subscribe: List-Unsubscribe: On a 104 thread, 2 socket Skylake system, Intel report a 4.7% performance reduction with will-it-scale page_fault2. This was due to reducing the size of the batch from 32 to 15. Increasing the folio batch size from 15 to 31 gives a performance increase of 12.5% relative to the original, or 17.2% relative to the reduced performance commit. The penalty of this commit is an additional 128 bytes of stack usage. Six folio_batches are also allocated from percpu memory in cpu_fbatches so that will be an additional 768 bytes of percpu memory (per CPU). Tim Chen originally submitted a patch like this in 2020: https://lore.kernel.org/linux-mm/d1cc9f12a8ad6c2a52cb600d93b06b064f2bbc57.1593205965.git.tim.c.chen@linux.intel.com/ Tested-by: Yujie Liu Fixes: 99fbb6bfc16f ("mm: make folios_put() the basis of release_pages()") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202403151058.7048f6a8-oliver.sang@intel.com Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Shivank Garg Reviewed-by: David Hildenbrand --- include/linux/pagevec.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h index fcc06c300a72..5d3a0cccc6bf 100644 --- a/include/linux/pagevec.h +++ b/include/linux/pagevec.h @@ -11,8 +11,8 @@ #include -/* 15 pointers + header align the folio_batch structure to a power of two */ -#define PAGEVEC_SIZE 15 +/* 31 pointers + header align the folio_batch structure to a power of two */ +#define PAGEVEC_SIZE 31 struct folio;