Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2845143pxb; Mon, 19 Apr 2021 15:51:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMZOP+Pc1JeCyA/GCPBO1wxS8k9SHHJRfOaxyzNsCLdGxQthDvP44BlmzC0ZjEMNf8D9Ut X-Received: by 2002:a05:6a00:174a:b029:25d:642e:8201 with SMTP id j10-20020a056a00174ab029025d642e8201mr10841627pfc.59.1618872705684; Mon, 19 Apr 2021 15:51:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618872705; cv=none; d=google.com; s=arc-20160816; b=TDr2jHkLtKakDS0oKPDBahU8d+dW6fmFavmBcfmDt7MFoEJPl3p2ZiUh71me7HyS9f PjsP6OxuiWxRxcRGZNTl16QfjWvAwEecKfwXdw64ftT9wTxSb4+bAFFiuXysb+HYjRHF kEZnXP4diG4fggPrfm/PrqaLLPEntuchhzmkflXVRW5cJ76WxVRu9zrJ0b2OwuQ4JDSD H3LyrA/28XwBPHhl1vqVQPULjJ/i7YirHxlpa/uuQYZfTGG89PwbubVAGXxwfZ4pvpaJ fEY8pOdnRyETVcWSiy/hSytqXnfFaBbJ5WzqCHgJqJjxO8vVqxFzeQjJxAcADGfvIevY kaXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Tdto6eIFZj79NTB2sahhhHxHCQcjLnGHA5qMcw/UR6I=; b=rNxmk1kduqDTewB3UA+q1swRk9vz52MDv0HNl1IOn0nDgBJiq1pqfmjYr2zP8hml1T pUDSxyMWIqcVUX9vRc9eXF3GmtMCDyRhS4zC+LOsbYVn4J393j+8rV71828FmVMf09Fc l8uIX6MC2B7nfUS+3nwRWnLb+IzzzfU3Un0Kf6/KNWRkorHmDavR37ufW8EKVMykbFS2 fvsrXsd5IDp9TS58ZMx12u/zHcav3XzzBjHGdD7kALtgI982Y6Dh6E3CVG38NvNbFt2Q p4gdj3ylIHB0K+L+ZWpNW1rMFolViJPO878LRmD3XaYKJMWSJNnX/v7qTvGdLYexsmia 8vhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i15si18020324pla.114.2021.04.19.15.51.33; Mon, 19 Apr 2021 15:51:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230126AbhDSWv3 (ORCPT + 99 others); Mon, 19 Apr 2021 18:51:29 -0400 Received: from mail-io1-f46.google.com ([209.85.166.46]:33509 "EHLO mail-io1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229799AbhDSWv3 (ORCPT ); Mon, 19 Apr 2021 18:51:29 -0400 Received: by mail-io1-f46.google.com with SMTP id a11so34450268ioo.0 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=f4ofy7FEe6jUFEhFYRrppzBenoNPNEXHITJdB0REjMvLob4PYF05G5vXhR2lwpJXnv kXIbvh5IhO3R2xvk+hI9fevTWnyB7NdWthusLZI5vJyqpvEwHb+NzquyI7BfK13Dlmcx 23nXRAIfvWu+qfd1do8+BPeLkKZ9pBAarPBOqfUChFAfEzasf3FOU/PK8xJirDtsJEQz gc44nJBkm6lGSRmnyTM24ndMXhe8+1QEzCsb5nwwf15j+kmrCLGf69tuLOztJP011K+T LwZu9clE+FmPP6i/iV5if9HB3xmHEp+iht1/kjrAS6puOOxqa/3Y8EnQH4VD219Mlw+y UnwQ== X-Gm-Message-State: AOAM5321E4e0Z7fvSSl5GIvAQA4yMe96VkkXJkHVrgRw92VSQmOyxFGf Kn+I7XxORoiIKk5pmYLrYLI= 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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