From patchwork Fri Jul 26 20:31:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Gushchin X-Patchwork-Id: 13743175 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 51A13C3DA49 for ; Fri, 26 Jul 2024 20:31:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D83096B0085; Fri, 26 Jul 2024 16:31:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D331C6B0089; Fri, 26 Jul 2024 16:31:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BFAFA6B008A; Fri, 26 Jul 2024 16:31:26 -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 A0B066B0085 for ; Fri, 26 Jul 2024 16:31:26 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 156F340147 for ; Fri, 26 Jul 2024 20:31:26 +0000 (UTC) X-FDA: 82383048972.27.4B28491 Received: from out-175.mta1.migadu.com (out-175.mta1.migadu.com [95.215.58.175]) by imf09.hostedemail.com (Postfix) with ESMTP id 37E7B140034 for ; Fri, 26 Jul 2024 20:31:23 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=YtCeW5XM; spf=pass (imf09.hostedemail.com: domain of roman.gushchin@linux.dev designates 95.215.58.175 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=1722025834; 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=jVngEr7hAv0PSmXL/CDo3XzyDWAw8oWbbYbtru/rxEU=; b=VlwqK1+6U9S/Nl/WfVmL+SPwK0W/+o/ztWTmbJvY5hKn6Z/uvIG0bSUn1QbNRAh+fR9Ou4 IQc/mwF6ymkR65DvG1Smo04ls3uHG8yx/lpI173sutEFfKgk3V/69prAJLdWHrSoo7tYD9 m0XUxJqWysoybqrGkRLRaG12GJpSl2g= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722025834; a=rsa-sha256; cv=none; b=gBhX8Y4uD8OtbHXdQThkLjga/KmBzoDyy3O/gHFm6uE0SOLUWToOto9EqygX/EBFfcOJ47 hNKD41qkLuCXJ2zOf/2JcxObfNvOSzpftpyv9btKp63Z5UuJfNSeQXo0fQkq9+E/fXE6O+ AkEFPcUkjzpBLu7tY6TvBfuT4E+zh54= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=YtCeW5XM; spf=pass (imf09.hostedemail.com: domain of roman.gushchin@linux.dev designates 95.215.58.175 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev; dmarc=pass (policy=none) header.from=linux.dev 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=1722025881; 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=jVngEr7hAv0PSmXL/CDo3XzyDWAw8oWbbYbtru/rxEU=; b=YtCeW5XMlpGsaZmd5H5xQV6XaEnKZzhpdX6OhmlW11FG6mbIxzD+jesZ0w1vLWfoHFcqRF GBsuDGYgu08+2spEw595rkjItb5yxu5KcSVUu7HFL4csVOLe02SdFmgJvOCeBs/vOjFdOd hBeUB+uST2xd4wsLh8+Bnfzqn2bt5Tk= 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 v3 0/3] mm: memcg: page counters optimizations Date: Fri, 26 Jul 2024 20:31:07 +0000 Message-ID: <20240726203110.1577216-1-roman.gushchin@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Stat-Signature: yb354nc5389kcmfintna6wi6ft4dd3t4 X-Rspamd-Queue-Id: 37E7B140034 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1722025883-327163 X-HE-Meta: U2FsdGVkX19sSY7DXyBNg7cRie90K03so6gjjUl2s4dQCXn3lYJS900wPteAppzgcjp/KoupYzR6yhe18BW5UOtvnqyzD0350S4SLcNyTOPPaXlBJxxDdyBY6tNT5EQF004H7myJ3XGoMgfK8RgozyiPPUJUOgeclJxFC+to+acOr1KxWgKWzIrVGjY/K7eHB3YKRWq3+fyWpxZF3dgW3Jkfr3h4pAI0Q1UbIAnGXV5r4/mEpKd2njeRBUYFPngVVCtYkWOOUa22yTKST86VMXhmozl1WREJ2I22w3b2BOa1NVZTtD0CuSkZ2yCEzJOwkR5PXmmXcYX5NUfcv/VHqD/bxO998hsmnt3x+sp34OA+yg94MbEtCWifYtoroz/eGhEDYTKCwjNsf3qv1u7Z0rNCQfRqXoLDYZz0h7cE95xp81Ed1NW9ZEAAnZltIpUlVN6af2TJ5oxYauw/Rpz1PdV33OCXVZHb88wViJu01EZGxwk8BUJINzorRWVM+/9tl/HK/BppgfP5koDocMkUSTCPUDTrqpsfQxMec5mly09mKCIdVvJEeSYBonUhcNyw/d69AaJlureHKOJuFwO9Vsfuq5W4+ZxS0ov75y3uSLGEYLV7HmjJ9fTvRiFzy3NfdN0G8DV+KDE6VO6gDVhek1kPvBDC4wwHR7xVpkZKF+yAcXFkPpHFLzf4qEMa82oMVsFEPcwJX9sw6hqocdmOSOO5CKbxJwEkM2u7awXLiM0xPMc+9f3Z1c0IAM9IYHMBIn7uWoxLIZfwXGjmnkpYFqctrB8KCS6Hkc56LSjY8Zjd79HoNfEuesinq8+XMS9/L7l5GPINxv3GrZ6kR7t/yCHxyG2SIkNk3ERBB7AylXgQvpRF4LohoQq8CtDeDl6j9CmIzygpXVWjOKzb8FNNhdcUiD9eL/+HaLl5FPhOxNIRXSdoB5NkfuLmo8fnLjGeqNmgX+TT/k+cfQRLo9w XulZ8JP+ fKlACE/40SrHTt+2R590sJpcGqmixbxGI+5zc/9H+QQ8S7zttNi1YWPOr1LdcHhjlrcdMOuexTLlqNkc8n2rjgupOjX7HGmUdRCWHcHPW+Np8hxrpYKYGUSwzwZkpjNIswyqJmyeRjVX7eht1DwJNmeu39iTMlRUi09hW2nJ//RggZsw= 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: This patchset contains 3 independent small optimizations of page counters. v3: - dropped the main part based on a feedback from Johannes - rebased on top of current mm-unstable 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 (3): mm: memcg: don't call propagate_protected_usage() needlessly mm: page_counters: put page_counter_calculate_protection() under CONFIG_MEMCG mm: page_counters: initialize usage using ATOMIC_LONG_INIT() macro include/linux/page_counter.h | 16 ++++++++++++++-- mm/hugetlb_cgroup.c | 4 ++-- mm/memcontrol.c | 16 ++++++++-------- mm/page_counter.c | 18 +++++++++++++++--- 4 files changed, 39 insertions(+), 15 deletions(-)