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 12DA3C433EF for ; Sun, 3 Jul 2022 23:28:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9EE4D8E0001; Sun, 3 Jul 2022 19:28:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 99E076B0073; Sun, 3 Jul 2022 19:28:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8B39E8E0001; Sun, 3 Jul 2022 19:28:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 780F46B0072 for ; Sun, 3 Jul 2022 19:28:24 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 183E321807 for ; Sun, 3 Jul 2022 23:28:24 +0000 (UTC) X-FDA: 79647379728.24.19F1E79 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf11.hostedemail.com (Postfix) with ESMTP id B910740035 for ; Sun, 3 Jul 2022 23:28:23 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1820A611B8; Sun, 3 Jul 2022 23:28:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FD2BC341C6; Sun, 3 Jul 2022 23:28:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1656890902; bh=aEIGXJCrTumxaF3V0DderfrmrH0jO1WyIFbOI/yMixw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=XgbQhYjIGDLZiG0Dhro2Rsr+hRmWMjyG8YOas3RxDMBM7GniGrmVreuyJFmRd6UPR YvvWlxPb/unCQ0yNA7Y2V4m9PIoy5oSXNuZx883GlFlFSAdk9hNJltdu/PdzG4LlPt TqbaP4VyTeSnu8GrvVaTc6PNA86FQEiBKm+rqZ2U= Date: Sun, 3 Jul 2022 16:28:21 -0700 From: Andrew Morton To: Mel Gorman Cc: Nicolas Saenz Julienne , Marcelo Tosatti , Vlastimil Babka , Michal Hocko , Hugh Dickins , Yu Zhao , Marek Szyprowski , LKML , Linux-MM Subject: Re: [PATCH v5 00/7] Drain remote per-cpu directly Message-Id: <20220703162821.f097d6e4b3e2a0114820a8d9@linux-foundation.org> In-Reply-To: <20220624125423.6126-1-mgorman@techsingularity.net> References: <20220624125423.6126-1-mgorman@techsingularity.net> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656890903; 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:in-reply-to:references:references:dkim-signature; bh=KRmCyCl6hfKaskylHdwvMdCosKC56h7IkhXi/YqCgDw=; b=fQQiiIpIcWgkKlq6BCPBlKnQghEEPqL4OLMolcbABO7YLTt7aasY+S41wv82zjI8g/kLTX 6xlJDyaLEio44dhlqsqRp9GN6btimYnCsE84jbBarn0309fG34Fp/1xyr870K3hbKxshdx JM+9GRdx7v4SdYWG3nZpX5VD9Oi1v8w= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656890903; a=rsa-sha256; cv=none; b=zF+4tSRcEe7NEwubMJiM7QiuyO5wafkGlUq7VGoHtJoCzg+HDGuXgwina7EplFCrGQnjPV mOWKTw9hPD7M8JxBthHikyCjQ+knm6qrSbiRNesVF8WP2H7LdH3xiTZAVQ7QSHmvnVRbh5 Hf8X+nuiO0HB9RFf3uAZWqOkpjjDfm8= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=XgbQhYjI; dmarc=none; spf=pass (imf11.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=XgbQhYjI; dmarc=none; spf=pass (imf11.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspamd-Server: rspam03 X-Rspam-User: X-Stat-Signature: 7tuoi4y9gnjrsg3jh3j9s4dzahjc714c X-Rspamd-Queue-Id: B910740035 X-HE-Tag: 1656890903-65738 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 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.