From patchwork Mon Apr 19 22:50:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Zhou X-Patchwork-Id: 12212775 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=BAYES_00,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07A06C433B4 for ; Mon, 19 Apr 2021 22:51:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 72F5361354 for ; Mon, 19 Apr 2021 22:51:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 72F5361354 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8BD5A6B0072; Mon, 19 Apr 2021 18:51:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 846206B0071; Mon, 19 Apr 2021 18:51:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 671DC6B0070; Mon, 19 Apr 2021 18:51:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0083.hostedemail.com [216.40.44.83]) by kanga.kvack.org (Postfix) with ESMTP id 4646D6B0036 for ; Mon, 19 Apr 2021 18:51:00 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 067C81E1E for ; Mon, 19 Apr 2021 22:51:00 +0000 (UTC) X-FDA: 78050613480.21.0EDF4C6 Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by imf05.hostedemail.com (Postfix) with ESMTP id E99B7E000118 for ; Mon, 19 Apr 2021 22:50:58 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id e186so36571818iof.7 for ; Mon, 19 Apr 2021 15:50:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Tdto6eIFZj79NTB2sahhhHxHCQcjLnGHA5qMcw/UR6I=; b=BgSfuJW2k/EusRnJMsxMVnaIji4QeVfVADn2TNxeqP0NTgwe1Jgk8jQeCI018HLoyr KpMLY/5A77kl1aWo7bXdJY0dw3d3FZBIBAuG4fP4lhvKb0d7kAuFxtwEWT+BVlmYvf5h JtRHu5RvHAQitWR087VOXeVpNKPO9imX+up4yCSAVqbKo1SpLehgPQf4PQX9XKEwC/Il aKpRip3A4ZqQktVUknvzOOY6E1NPxy8KMCfDQAFF6UF0zfsmmKOqf26v9DISRjj0R6O/ K8hRN2QCdbPGzLzPHl5VcZv3Vcp1g9Um3QFzRQqGL73KGC0yTffGJPzhxwcExQF0o8D9 dyiQ== X-Gm-Message-State: AOAM533lpahnVa7qC7IryLi7JbkdpStkYzUFppbYiKE3Tym0FSPat4ym OMvEdm8AIm8Ykks+thkvOJc= X-Google-Smtp-Source: ABdhPJwREyAaz7MwQNfl5RAG7pqM97qm228tj7EoAQXgKgVZ67pjazRLnes6lIUpKxBM41PT6ckAOg== X-Received: by 2002:a02:a10d:: with SMTP id f13mr18649051jag.72.1618872658496; Mon, 19 Apr 2021 15:50:58 -0700 (PDT) Received: from abasin.c.googlers.com.com (243.199.238.35.bc.googleusercontent.com. [35.238.199.243]) by smtp.gmail.com with ESMTPSA id d7sm7566967ion.39.2021.04.19.15.50.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 15:50:57 -0700 (PDT) From: Dennis Zhou To: Tejun Heo , Christoph Lameter , Roman Gushchin Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Dennis Zhou Subject: [PATCH v4 0/4] percpu: partial chunk depopulation Date: Mon, 19 Apr 2021 22:50:43 +0000 Message-Id: <20210419225047.3415425-1-dennis@kernel.org> X-Mailer: git-send-email 2.31.1.368.gbe11c130af-goog MIME-Version: 1.0 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: E99B7E000118 X-Stat-Signature: ymmjf1hca57zoopdzkzwg73ti1tpzuzh Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf05; identity=mailfrom; envelope-from=""; helo=mail-io1-f46.google.com; client-ip=209.85.166.46 X-HE-DKIM-Result: none/none X-HE-Tag: 1618872658-569691 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000117, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hello, This series is a continuation of Roman's series in [1]. It aims to solve chunks holding onto free pages by adding a reclaim process to the percpu balance work item. The main difference is that the nr_empty_pop_pages is now managed at time of isolation instead of intermixed. This helps with deciding which chunks to free instead of having to interleave returning chunks to active duty. The allocation priority is as follows: 1) appropriate chunk slot increasing until fit 2) sidelined chunks 3) full free chunks The last slot for to_depopulate is never used for allocations. A big thanks to Roman for initiating the work and being available for iterating on these ideas. This patchset contains the following 4 patches: 0001-percpu-factor-out-pcpu_check_block_hint.patch 0002-percpu-use-pcpu_free_slot-instead-of-pcpu_nr_slots-1.patch 0003-percpu-implement-partial-chunk-depopulation.patch 0004-percpu-use-reclaim-threshold-instead-of-running-for-.patch 0001 and 0002 are clean ups. 0003 implement partial chunk depopulation initially from Roman. 0004 adds a reclaim threshold so we do not need to schedule for every page freed. This series is on top of percpu$for-5.14 67c2669d69fb. diffstats below: Dennis Zhou (2): percpu: use pcpu_free_slot instead of pcpu_nr_slots - 1 percpu: use reclaim threshold instead of running for every page Roman Gushchin (2): percpu: factor out pcpu_check_block_hint() percpu: implement partial chunk depopulation mm/percpu-internal.h | 5 + mm/percpu-km.c | 5 + mm/percpu-stats.c | 20 ++-- mm/percpu-vm.c | 30 ++++++ mm/percpu.c | 252 ++++++++++++++++++++++++++++++++++++++----- 5 files changed, 278 insertions(+), 34 deletions(-) Thanks, Dennis Tested-by: Pratik Sampat Signed-off-by: Dennis Zhou