From patchwork Tue Jul 16 13:59:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Roberts X-Patchwork-Id: 13734538 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 97CAAC3DA59 for ; Tue, 16 Jul 2024 13:59:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 036276B00A2; Tue, 16 Jul 2024 09:59:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F00A36B00A5; Tue, 16 Jul 2024 09:59:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA16F6B00A8; Tue, 16 Jul 2024 09:59:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id BB9516B00A2 for ; Tue, 16 Jul 2024 09:59:18 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 415F38178C for ; Tue, 16 Jul 2024 13:59:18 +0000 (UTC) X-FDA: 82345772796.26.487447B Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf02.hostedemail.com (Postfix) with ESMTP id A1DC480029 for ; Tue, 16 Jul 2024 13:59:16 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf02.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721138325; a=rsa-sha256; cv=none; b=f5gSuABX3FlGFaKAuvc6WVoSVosr/q0GdMvuqPZUOU3Pza3aZrUn29FTGyqL/UJ7T1VFWb Ox3/DavznaDunV6V2kVSLNp3VBx2bDAGU3a3OlynwKd89zP6i9+QMiEpI/y9boNqZRIuIQ /9eoaxSUF2KKILiqCcWbKlsUeJ7oHE8= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf02.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721138325; 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; bh=Px+kAnAxi9BLQBNPh494awLVAW1WrlPRx5y3RWa9ASM=; b=0q9Jgrtwd4fKO9h3RubI0KH2V7IHN8gfOWEaZL7QBCAJfJLrCW7fNxRFOZQbVMsGE8EGrb tp/pr9valxypP0fYqm9PXCh7mZOV/rwcNJzv5bqw10bF4OMNlsa+prRTIBOjsPR4g1LQSF AHwJfmdSE2g7G12OFvcWvpmBZX0vuvw= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 121D51063; Tue, 16 Jul 2024 06:59:41 -0700 (PDT) Received: from e125769.cambridge.arm.com (e125769.cambridge.arm.com [10.1.196.27]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 474593F762; Tue, 16 Jul 2024 06:59:14 -0700 (PDT) From: Ryan Roberts To: Andrew Morton , Hugh Dickins , Jonathan Corbet , "Matthew Wilcox (Oracle)" , David Hildenbrand , Barry Song , Lance Yang , Baolin Wang , Gavin Shan Cc: Ryan Roberts , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 0/3] mTHP allocation stats for file-backed memory Date: Tue, 16 Jul 2024 14:59:03 +0100 Message-ID: <20240716135907.4047689-1-ryan.roberts@arm.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: A1DC480029 X-Stat-Signature: e3gdttu8wady33pyk3fptx9974dnraqk X-Rspam-User: X-HE-Tag: 1721138356-728132 X-HE-Meta: U2FsdGVkX1/hCB4MFIz80XpnrBGvjrToB5LHsRIFKWLaG4N4OY+wkGfa/0ofFOA6PdIumJXtVI8x5702mWejdLa8ZbWkjdg0Tubem9lMyQdjeOdg7co/NppZ/Fktt12wooj59Bmn4kL7dBU/uo/Wi69dFGpCIV2iRukCt59fofw2A3odzQSUQsKVNeOheOzzgZ7lZjHgW/DC5hwGoqOTw77a3EBFqwqvFwt4FQ1heyUqtnXjwl7QAA7HQejjLyzVxH2mdN+H9yhYTZd7Qw7Q26cu+pQrfY4vgdyvN4Xhj+dAkG5oFsJUMuoYH2P/5Hj6N9WDa7SJInmH151cvE/D8rl0s9/L3wmiIBVW0mJ2MUXsWYFXVkbOutdj2H6XWha4WoaUm9b6Wn75cmO3VxvqSfzp4FJH66XmrowfsPo/E9Wmat5dSCSu5GU7hQLh5b6V+xx6+19dFCH25tHlhh+VsucS947w+Va/SfhwbZrMn7X+2nquLJ6vQ9LQ8N+NyV06YSg79+dN/4F7vHGEZjHx49NNwXQK4CdDxR7GC5nf9gHFyQlVT/rWBJPGC49LimzU+L+xAK1sberni2DbBKsObMRO0EEHevkcpE65Fe9YCRyA1piCa6/ElPPIsITQilMNAZeRYP5wvRCMWhGYA8FUHveJlIQ2mYJKiE0MjqYHUtKwXabKGdFbkC/igkKBSJxXIbsrYiOgnM9y4pVCsSJ/bRv8TPTzxkLYPzvCDScO3/ssgC8NJahZ+BtZ4TIdDmLMOIzW89yOYPZsTlQrFJis6bOO+fuz5u0oGwD6ILmInv2yFJ+GiArCRSllTcHF/kZDH4EOLMcgH69j/5OmtgFH3oqfWKw62ZC/cSvlyG1EH8G5UQcKqDzFpoH6VGeJksPLr5dqa36zrx0kSsUXY+Ok1es2LwgZqDRfrtVk4F76+5qRLLVY9TE3m9gL437lvMTl8IxlG9I6V/xdzPd5mSB gLD3T3dZ oUs5NHHHpVTV0177oq1qgmB5PPLqd57dG/thmaqgwBeAvbUsToRXDSFcHFK2F7tRDHiJkHrVH76Puby5AZH1ZaWzudscPpUjroP6Sz7Ek6oe3NYkf5tbxCDaeHOdEBPbBIohB0dGY0PpVSgbi0qlbh9CsCeUsYhQSFrEdF8qGrrF30l1l9itb+giGJa3jwCQWEKJBj16yeATuxoiES7gMx52JgQ== 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: Hi All, With the mTHP shmem stat names cleaned up [2], we can now introduce real "file_" stats for file-backed memory. This series does that. The stats are useful to give visibility into how file-backed memory is being allocated. I'm planning to build upon this with controls to restrict the folio sizes that can be allocatd for pagecache (subject to test results that demonstrate the value). --- This applies on top of today's mm-unstable (650b6752c8a3). All mm selftests have been run; no regressions were observed. Changes since v1 [1] ==================== - Added patch 2 to tidy up shmem controls; now exposed for order-1, and not exposed for any unsupported high orders. - Simplified "stats" subdirectory management with sysfs_merge_group(). - Added R-b/A-b to patch 1; thanks to David, Barry, Baolin, Lance [1] https://lore.kernel.org/linux-mm/20240711072929.3590000-1-ryan.roberts@arm.com/ [2] https://lore.kernel.org/linux-mm/20240710095503.3193901-1-ryan.roberts@arm.com/ Thanks, Ryan Ryan Roberts (3): mm: Cleanup count_mthp_stat() definition mm: Tidy up shmem mTHP controls and stats mm: mTHP stats for pagecache folio allocations Documentation/admin-guide/mm/transhuge.rst | 13 +++ include/linux/huge_mm.h | 73 +++++++------ include/linux/pagemap.h | 16 ++- mm/filemap.c | 6 +- mm/huge_memory.c | 117 +++++++++++++++------ mm/memory.c | 2 - mm/shmem.c | 6 -- 7 files changed, 156 insertions(+), 77 deletions(-) -- 2.43.0