From mboxrd@z Thu Jan 1 00:00:00 1970 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 51E85C43334 for ; Sun, 3 Jul 2022 23:31:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DE8EE6B0072; Sun, 3 Jul 2022 19:31:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D96AA8E0002; Sun, 3 Jul 2022 19:31:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CAD0D8E0001; Sun, 3 Jul 2022 19:31:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id BA1F56B0072 for ; Sun, 3 Jul 2022 19:31:46 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 8883E2186B for ; Sun, 3 Jul 2022 23:31:46 +0000 (UTC) X-FDA: 79647388212.22.5DCFA57 Received: from mail-ua1-f51.google.com (mail-ua1-f51.google.com [209.85.222.51]) by imf25.hostedemail.com (Postfix) with ESMTP id 2B527A0049 for ; Sun, 3 Jul 2022 23:31:46 +0000 (UTC) Received: by mail-ua1-f51.google.com with SMTP id s38so435155uac.6 for ; Sun, 03 Jul 2022 16:31:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oEO3ZAtLSmva9cTvHxOfhLeXKa0Sb2FJy/TH2IplwFs=; b=q/yp860yzduw4091UcB3dvkiF4QIOV88L50p9WNSsr9wL+Mm2O5PiqyAB6AgL90g2L BVOpVsgPvXDONubZ1BlEa3gMuNwCqz0oPE+DC8wKAvtGTRlqAu6cVduLJdFYpyWMOiNz 6TZlyML+IEjtvvw8F+Yq39ApNjedtHU+RYtbpd/P0mG6kwwtsxkIi0GnQ4IDBwRXRvDs Ek6Qb3S9Jo7aVpqofJ8XCvPrPpkCpcVutBA9gmh2Lq3SgOaaSnTTDZEAw2Z2cQXYRjN0 9EyPvg7W6HbOu4zHzVRoIo7Hety1a1/dlsmjZT2Af56XDHUF/TyDDbFZp9Qee6CnZNjr sq1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oEO3ZAtLSmva9cTvHxOfhLeXKa0Sb2FJy/TH2IplwFs=; b=witCgRnDUuYHMAkoDaLFpQNbXhqRdtTPMvVHmf/lonEwAZFBnG2yBOnHVkefzM8/l7 K5mXOSTedokWS3j7/YicPoQlFBpsE8yP3694c8zUc8wp1OLKqjG8NmiuBL2nS2z7vW6K jt6NG2QzN3lc82xaPLjo1h+5Z5h3nyehCe17h/xb79jHhH3YfIUGye2w3CZkcuEqTrq/ 96Gn4IONjxpndQ7ODfBMBcYNCmqRm1V22HT34+Gu3OAhn2iY7lPfYWqfSIGBWSNeHzp6 xHL+E8HY4Cvz2WbNn1kR6LnPLi2mqeu5RrrArtMy2EJ2OoUMFPFTFt2GE8UKVx4h+T5G u2mw== X-Gm-Message-State: AJIora/I8sK6YNSL4nQmhsX4pONgXSip/n6ZFT3BVRqMH4H6d8FRFTYg +M5hcj8xMOM5zo0jR/FodWxZJaJKgPxsWFcl3f+DMw== X-Google-Smtp-Source: AGRyM1tYVib0ciKdPLNgy5ux8YG1sr2MoZkycIznHFQlzrvfkvyDn+EngC17+CZieedxeMjYrvqjKxzk3obkgg42m1w= X-Received: by 2002:ab0:7085:0:b0:382:9454:962 with SMTP id m5-20020ab07085000000b0038294540962mr534399ual.113.1656891105246; Sun, 03 Jul 2022 16:31:45 -0700 (PDT) MIME-Version: 1.0 References: <20220624125423.6126-1-mgorman@techsingularity.net> <20220703162821.f097d6e4b3e2a0114820a8d9@linux-foundation.org> In-Reply-To: <20220703162821.f097d6e4b3e2a0114820a8d9@linux-foundation.org> From: Yu Zhao Date: Sun, 3 Jul 2022 17:31:09 -0600 Message-ID: Subject: Re: [PATCH v5 00/7] Drain remote per-cpu directly To: Andrew Morton Cc: Mel Gorman , Nicolas Saenz Julienne , Marcelo Tosatti , Vlastimil Babka , Michal Hocko , Hugh Dickins , Marek Szyprowski , LKML , Linux-MM Content-Type: text/plain; charset="UTF-8" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656891106; a=rsa-sha256; cv=none; b=sDm7uMNfnyMXPs1rh+0WeBcHCJcMD5W01i2hEgppPZwo8vlVPcbtvoFsrFex8u13Ldvh+o P3BID3PG7U9Z1jZUMOijECpcO63jM4Z0eIkfWENMNGMpLkaimIwXCXT+EUbUmXOoOpgidV jPvPzoshCmy0f7D2SoRgF72oXSJzEFU= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b="q/yp860y"; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf25.hostedemail.com: domain of yuzhao@google.com designates 209.85.222.51 as permitted sender) smtp.mailfrom=yuzhao@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656891106; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=oEO3ZAtLSmva9cTvHxOfhLeXKa0Sb2FJy/TH2IplwFs=; b=vXiRmGYi0jBpC1AFxpZeSxWKBBnmGejXP0I0IbGtIWhevS+69T0WfrVlQ51O8Pg/TFBXaK d1ATZqtYQLVqYHkr4yeJcIGNTzoqjVLoZ7lk8CVLqVwFEuTA5iCxb7wttVzuEvRKLMXiwW Ahn1F+cBNYRyUMbQpVCXwdCs2G4AHx0= X-Rspamd-Queue-Id: 2B527A0049 X-Rspam-User: Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b="q/yp860y"; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf25.hostedemail.com: domain of yuzhao@google.com designates 209.85.222.51 as permitted sender) smtp.mailfrom=yuzhao@google.com X-Rspamd-Server: rspam02 X-Stat-Signature: 7uygauy3ndt4xstyxjymnik86r7sze96 X-HE-Tag: 1656891106-330267 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: On Sun, Jul 3, 2022 at 5:28 PM Andrew Morton wrote: > > On Fri, 24 Jun 2022 13:54:16 +0100 Mel Gorman wrote: > > > Some setups, notably NOHZ_FULL CPUs, may be running realtime or > > latency-sensitive applications that cannot tolerate interference due to > > per-cpu drain work queued by __drain_all_pages(). Introduce a new > > mechanism to remotely drain the per-cpu lists. It is made possible by > > remotely locking 'struct per_cpu_pages' new per-cpu spinlocks. This has > > two advantages, the time to drain is more predictable and other unrelated > > tasks are not interrupted. > > > > This series has the same intent as Nicolas' series "mm/page_alloc: Remote > > per-cpu lists drain support" -- avoid interference of a high priority task > > due to a workqueue item draining per-cpu page lists. While many workloads > > can tolerate a brief interruption, it may cause a real-time task running > > on a NOHZ_FULL CPU to miss a deadline and at minimum, the draining is > > non-deterministic. > > > > Currently an IRQ-safe local_lock protects the page allocator per-cpu > > lists. The local_lock on its own prevents migration and the IRQ disabling > > protects from corruption due to an interrupt arriving while a page > > allocation is in progress. > > > > This series adjusts the locking. A spinlock is added to struct > > per_cpu_pages to protect the list contents while local_lock_irq is > > ultimately replaced by just the spinlock in the final patch. This allows > > a remote CPU to safely. Follow-on work should allow the spin_lock_irqsave > > to be converted to spin_lock to avoid IRQs being disabled/enabled in > > most cases. The follow-on patch will be one kernel release later as it > > is relatively high risk and it'll make bisections more clear if there > > are any problems. > > I plan to move this and Mel's fix to [7/7] into mm-stable around July 8. I've thrown it together with the Maple Tree and passed a series of stress tests.