From patchwork Wed Jul 24 20:20:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Gushchin X-Patchwork-Id: 13741324 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 EB893C3DA63 for ; Wed, 24 Jul 2024 20:21:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 690506B0083; Wed, 24 Jul 2024 16:21:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 640EE6B0088; Wed, 24 Jul 2024 16:21:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 536486B0089; Wed, 24 Jul 2024 16:21:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 3A2766B0083 for ; Wed, 24 Jul 2024 16:21:16 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id CEA1DA0B93 for ; Wed, 24 Jul 2024 20:21:15 +0000 (UTC) X-FDA: 82375765710.27.44C94CC Received: from out-189.mta1.migadu.com (out-189.mta1.migadu.com [95.215.58.189]) by imf13.hostedemail.com (Postfix) with ESMTP id 0C78A20007 for ; Wed, 24 Jul 2024 20:21:13 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=ZQrbE+Tp; spf=pass (imf13.hostedemail.com: domain of roman.gushchin@linux.dev designates 95.215.58.189 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721852450; 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=0npymtNZgz0DBECHygFlaNJtaAtVe0cWcTtFllkCsWk=; b=zgD1L82wqgtArNtD3kdo/YnYNEkfKoBUtQJAYeYbjPXoTvxdsDPcmKeoDUjkul8rAqjehl BWoM6SUgiZaN5ZB1wK5WzA1hAAaXgu/1fpNOoz/UYXGyMhLMXm+NrjQJvRA0DBq26vMg1j /+ZqWW93xTPatAM35py2Uhfoj2cGJ3g= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=ZQrbE+Tp; spf=pass (imf13.hostedemail.com: domain of roman.gushchin@linux.dev designates 95.215.58.189 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721852450; a=rsa-sha256; cv=none; b=A4Z3BVTdpjV2PYl0jcq2dJQkUsWzryMQJ+m7m7eSFRlVXwguulLBxM440eggycDQaqiRxO DkCqVqTFMnPIDfPkINAR6nArRqG/vcg6f1073RExdIWAR8cLNJWs3Q7Wp8foSvgQuV8XbB pJsWS1xZxtckBdpPjdfFSFy+rmFWYbo= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1721852471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=0npymtNZgz0DBECHygFlaNJtaAtVe0cWcTtFllkCsWk=; b=ZQrbE+TpLbYOuwx/UHswY0LFNAm0TWuJ76Rq/Z5W2bjyRNVpnld7tXcbsCieXbqOWLZgR6 5xCRE+DTg3e1dOccvrAQzPr8A49uhlsa/NSXCBu3rcJzI53AtAaXUD9/fADMlBiRb4nuZ5 kCbOPr8MNJLTX9e4fFCODt0k9c4//iQ= From: Roman Gushchin To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Johannes Weiner , Michal Hocko , Shakeel Butt , Muchun Song , Roman Gushchin Subject: [PATCH v2 0/5] This patchset reorganizes page_counter structures which helps to make Date: Wed, 24 Jul 2024 20:20:58 +0000 Message-ID: <20240724202103.1210065-1-roman.gushchin@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 0C78A20007 X-Stat-Signature: 9ukspqairootxtxpes3yjkztaojpck4n X-HE-Tag: 1721852473-484530 X-HE-Meta: U2FsdGVkX18G/+CCEZZCDDLTIyDxCazrWNHjBtfhsC7limae7u+NeUiOAJ+jodjZvp2cN5iZWmMq4nc0FGc6GcqJfVo/Mx3YnxFJRg6CRoL+QJkxtF3lA01tE/CaxGF1AV65g76kQX7XmMoWey/tcdD7clGUuPk0RvBTxZNYaPzOkDBqz5CRCvQbqMU20fRwxe8D0kdNnmElOmePDIG8k9MBCsrOi6+aOi3KnbuvMpJXHIkdnl5pC0/wyKWVAxxGQppRwIqVuBhI1nrF2V6iPLf73ZbMyvXLGqN0DkZtfUGJIpEhTiAe6NogIURWzVkb//lmZM0Fu+mc+MGlgx5OPDNTl1/v2YoaDCU4s9nXvEg9r86jjtSKNJDruK+PlV0mU3o9HznvMCAbr8Cr+IwUSvQmsbDLmrRN+8ldgK6YpAX6JDwDodQV65H8e9UQbMDq5no83rXqz5GeBy4ADKHeOcfG82WKL+4GlzKHK/VPT71OoaKelwHWxAWjH4f5uOIcKjoqt5/kxP+9BCwf8fRO7OfUFBIbVdy5bYsZUU3NqWk8gcRxNP0J60WZEIebtOd4xq+UYgnP00Bf6l4OHAQU5oNNcE+yoDSHT9K53eAcQATcATlRVm390IlpDgXw2r0IuAY09duNO61pOB+cLJ8xRmMMk/FUAlVjOmBOvKWpMTiY6N7NsysabDLIvCf9isM9NYEbiVsmu3SDXV/stY/8x/pQyjUguDpWUUxYulhjZ4xWVV1Q96uRz8IKSbTepSxQdEZK72Vvy8rqPlIHrAT4IyT4i71d9C6mPw2NO3Ax3587ZfOZQf7DBuvQYsnx19x4ziGs53UYzC2sWkelmWgrPpAZtL0GQczvQWZWn8WxdY+HW767ZGJeF5p2rjPfPoWzpEveLsTIbiqIGChxwvBVA/V5gF2N5J80XpZsTu+bFqB9Gtbh/wdb6OVSXMfKNQTs76IAWKuNRuUFde+yADH dVU95/SH Pa/X5z9uxK/HoUjZy6casspAH6zOfOiHn2BCH/Ef6cBX9PJg9dYy5Pc5XglZlCessrVVYt2KBxLVvcvWC7mIdMJRvrzpIDfYene1L6Hjs461rvLCa8fVh5nSwq4K+2k1FIrZknnuga2p9VuLuxf5osbHOYSYpb5XAYuPxgh++ufPQaE5Cy5LW0GS49rKs+maN7tmj7PXwYLFYEzE= 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: v2: - two page_counter structures per hugetlb cgroup instead of one - rebased to the current mm branch - many minor fixes and improvements v1: https://lore.kernel.org/lkml/20240503201835.2969707-1-roman.gushchin@linux.dev/T/#m77151ed83451a49132e29ef13d55e08b95ac867f Roman Gushchin (5): mm: memcg: don't call propagate_protected_usage() needlessly mm: page_counters: put page_counter_calculate_protection() under CONFIG_MEMCG mm: memcg: merge multiple page_counters into a single structure mm: page_counters: initialize usage using ATOMIC_LONG_INIT() macro mm: memcg: convert enum res_type to mem_counter_type include/linux/hugetlb.h | 4 +- include/linux/hugetlb_cgroup.h | 8 +- include/linux/memcontrol.h | 19 +-- include/linux/page_counter.h | 128 ++++++++++++++++---- mm/hugetlb.c | 14 +-- mm/hugetlb_cgroup.c | 150 +++++++++-------------- mm/memcontrol-v1.c | 154 ++++++++++-------------- mm/memcontrol-v1.h | 10 +- mm/memcontrol.c | 211 ++++++++++++++++----------------- mm/page_counter.c | 94 +++++++++------ 10 files changed, 403 insertions(+), 389 deletions(-)