From patchwork Thu Aug 24 03:35:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13363407 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 B4EE7C71153 for ; Thu, 24 Aug 2023 03:36:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1606C28005F; Wed, 23 Aug 2023 23:36:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E9F88E0011; Wed, 23 Aug 2023 23:36:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ECBF128005F; Wed, 23 Aug 2023 23:36:18 -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 D9CB48E0011 for ; Wed, 23 Aug 2023 23:36:18 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id B19321A01B4 for ; Thu, 24 Aug 2023 03:36:18 +0000 (UTC) X-FDA: 81157585236.01.D966D9E Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by imf16.hostedemail.com (Postfix) with ESMTP id 4357D180005 for ; Thu, 24 Aug 2023 03:36:15 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=AmQeV5ug; dmarc=pass (policy=quarantine) header.from=bytedance.com; spf=pass (imf16.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.210.180 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692848177; 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: references:dkim-signature; bh=0JbfRyB2vcpbgEbI5bcL+aaH/pKOG9tfRLOJc/3sbjg=; b=EOkfqdRqyGcnAvhdPNGHQx2oxUWZAoWjZlgH4EzzT4rkXKGEdtI5uQM661Kr2LZowEthGi WhgcbEBbhtZkgG197/3adbE4ZyT5he0/RVfb9zT1woBqWj4fG+urn0oCn1UYWe4kGsa0dG 6qCEi9c18Ylsuk9dxVwSmA2TB0dkEzw= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=AmQeV5ug; dmarc=pass (policy=quarantine) header.from=bytedance.com; spf=pass (imf16.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.210.180 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692848177; a=rsa-sha256; cv=none; b=e4ojcbbbRZpVS1mT8PwFNr/TWNU0hjLtwIZT5Ce47L16kfvxD/k5WcJeY6068rtU234m3P A6WXOi429glfrh/AfH4UXOB4MgnyjJjmUrw61G863PqxAdCnaeIqBSWAMvDImqfJBQRufz lZh3ITJ4p3WMj9lRhiRUo2jx6oHUPb0= Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-68824a0e747so1236735b3a.1 for ; Wed, 23 Aug 2023 20:36:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1692848174; x=1693452974; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=0JbfRyB2vcpbgEbI5bcL+aaH/pKOG9tfRLOJc/3sbjg=; b=AmQeV5ugpfZZk/4usllkCaeo1yH+UEXJG7jnjRc8qsNsDjPHxzLvzK5kA+yWBZeygJ QCqKnO1KHf3+eaN6ECbGrfa0j2v5LKRtFyUEy/g2RLEfv+j6XgMptGwJuiJlZXgRctDR 1nnjangfvZWRxM22knmOQhBjMh5+8kZXKYFdw6kEqV40Y7puFZ+EPVN5qqZqX1CCDlXK NX2tu+NjcfQnBPGwpvzf+O6OeU6GMUuaWrUR8aBMKqTlTLnD8yNu3RGk0KaXEBdC74Xr 0NM+Tlk2UHZgkp5BBPIerGy6xK/sweDwCZE9YbGgyUcwE7V2RgWUkzgPwzp5TYYR7s7D Q9dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692848174; x=1693452974; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0JbfRyB2vcpbgEbI5bcL+aaH/pKOG9tfRLOJc/3sbjg=; b=CsvCZMJNSIVZgferjf8vP7VgFwwU9bMiTRQ4BGVw3tL4bqJVjErpHBfUuOIb3Cdb0O fkNgEH+9HEfpmVoBy/ne3ofYHJmzdQu4Jae9gvHcsoZDGhiz87Cv7QnkiwaTa7cRaV5n FmLE3NPr7k+mzFYaNP+3YgEqPERNA2A1Xzf9Z7kw29kAhDKm8a7oojezZE/zst1SQ0rH jCxJ4fPWjoyjnr1x1RzsWP/zAwt9M7/21oRjfQjck9KUwFL7tVRFqPeKxe5ShwbhKhnT a4isyuBAO5GHmW/4WNBksWqgOyVBGDwddLAT1WkgUpDZYvgohKz73RMFEcvuRQFQmKoV s+Zg== X-Gm-Message-State: AOJu0YxUGvFtnRR39e4vD6tkuYzLLv+c7ruyT1BNpdKKApfru3M990Uq 8dfERAJtMLDTiXlDXRqvfg9vbg== X-Google-Smtp-Source: AGHT+IGrTGKA8Ukg4Uzs0bSKtsW+ppGLKZSPF9YJn/x2SceKMjMMpmj5eKgpoHo48YWv/+BWfzDTow== X-Received: by 2002:a05:6a21:788b:b0:13d:fff1:c672 with SMTP id bf11-20020a056a21788b00b0013dfff1c672mr19904947pzc.4.1692848173825; Wed, 23 Aug 2023 20:36:13 -0700 (PDT) Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.146]) by smtp.gmail.com with ESMTPSA id p16-20020a62ab10000000b0068b6137d144sm2996570pff.30.2023.08.23.20.36.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 20:36:13 -0700 (PDT) From: Qi Zheng To: akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz, roman.gushchin@linux.dev, djwong@kernel.org, brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com, cel@kernel.org, senozhatsky@chromium.org, yujie.liu@intel.com, gregkh@linuxfoundation.org, muchun.song@linux.dev, joel@joelfernandes.org, christian.koenig@amd.com, daniel@ffwll.ch Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, dri-devel@lists.freedesktop.org, linux-fsdevel@vger.kernel.org, Qi Zheng Subject: [PATCH v3 0/4] cleanups for lockless slab shrink Date: Thu, 24 Aug 2023 11:35:35 +0800 Message-Id: <20230824033539.34570-1-zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 X-Rspamd-Queue-Id: 4357D180005 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: kj7ujxg5wrfotz8s5hbexpw1err96fz4 X-HE-Tag: 1692848175-503774 X-HE-Meta: U2FsdGVkX19aW3SNhcmRmoy2+uAy3tnTqHes9DWzubt6dQK0ojV3FO3BN0YIRyo9K7AZGouIXLvREpjdCwjTVHjxjNQJlxAHSd/mhd3pfgQE06ztfOSQGIuLjrP9kHcCZAODMjycff5vJvPLc40aH+eysA4+ieRj5RW7auHuoTtOLRIFvhko7DYwi/VulopHGrg77/Uks3ON9WYb6Hbf4kMefkqJiRe4f957MfV5pM9dKQWZlcODMpnTSTemjCqdquu3fXqZ5P3DtwRaFVVv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6rYB3c3DIw9+KMxWyxZLCMHeuzvYr66AcoQXSAtd643u5QbUA4oF5Ys9jMGkHSCAchnIOqC5kgA43UZ1djQU3zbr4ysCnagH/+2ZI5ZdC2KArnAO9ynwEPVQtyNRharhaHDsZ4OE+Da4v2vONevpA== 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: Hi all, This series is some cleanups split from the previous patchset[1], I dropped the [PATCH v2 5/5] which is more related to the main lockless patch. This series is based on the next-20230823. Comments and suggestions are welcome. [1]. https://lore.kernel.org/lkml/20230807110936.21819-1-zhengqi.arch@bytedance.com/ Thanks, Qi Changlog in part 1 v2 -> part 1 v3: - drop [PATCH v2 5/5] - collect Acked-by - rebase onto the next-20230823 Changlog in part 1 v1 -> part 1 v2: - fix compilation warning in [PATCH 1/5] - rename synchronize_shrinkers() to ttm_pool_synchronize_shrinkers() (pointed by Christian König) - collect Reviewed-by Changlog in v4 -> part 1 v1: - split from the previous large patchset - fix comment format in [PATCH v4 01/48] (pointed by Muchun Song) - change to use kzalloc_node() and fix typo in [PATCH v4 44/48] (pointed by Dave Chinner) - collect Reviewed-bys - rebase onto the next-20230815 Qi Zheng (4): mm: move some shrinker-related function declarations to mm/internal.h mm: vmscan: move shrinker-related code into a separate file mm: shrinker: remove redundant shrinker_rwsem in debugfs operations drm/ttm: introduce pool_shrink_rwsem drivers/gpu/drm/ttm/ttm_pool.c | 17 +- include/linux/shrinker.h | 20 - mm/Makefile | 4 +- mm/internal.h | 28 ++ mm/shrinker.c | 694 ++++++++++++++++++++++++++++++++ mm/shrinker_debug.c | 18 +- mm/vmscan.c | 701 --------------------------------- 7 files changed, 743 insertions(+), 739 deletions(-) create mode 100644 mm/shrinker.c