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 E8AF0C433F5 for ; Thu, 12 May 2022 19:43:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4A9F66B0074; Thu, 12 May 2022 15:43:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 45A126B0075; Thu, 12 May 2022 15:43:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 321856B0078; Thu, 12 May 2022 15:43:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 211846B0074 for ; Thu, 12 May 2022 15:43:30 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id F3A4B80409 for ; Thu, 12 May 2022 19:43:29 +0000 (UTC) X-FDA: 79458115338.01.88828C6 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf09.hostedemail.com (Postfix) with ESMTP id 0F8AA140099 for ; Thu, 12 May 2022 19:43:20 +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 ams.source.kernel.org (Postfix) with ESMTPS id 03E81B827FB; Thu, 12 May 2022 19:43:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A752C385B8; Thu, 12 May 2022 19:43:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1652384606; bh=svto5GyU8taVOq/ATPulnnBJz3xd5M+rVyqe8CVebaw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=rmovmyUL2offJz3vXskJXddvVytBjSxNCLtWsO6g2RLrlV+XxBLp8YuD3TY7BdnC1 j3YDo1fpVzkwlPVbFntxtw96yGrdnSVpijkj5BGVy04pmFlG7Z63VIdW5963smAJP5 qcC6to713PORGitmpKXz45Cn0itVlYWlmKdaN5XM= Date: Thu, 12 May 2022 12:43:25 -0700 From: Andrew Morton To: Mel Gorman Cc: Nicolas Saenz Julienne , Marcelo Tosatti , Vlastimil Babka , Michal Hocko , LKML , Linux-MM Subject: Re: [PATCH 0/6] Drain remote per-cpu directly v3 Message-Id: <20220512124325.751781bb88ceef5c37ca653e@linux-foundation.org> In-Reply-To: <20220512085043.5234-1-mgorman@techsingularity.net> References: <20220512085043.5234-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 Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=rmovmyUL; spf=pass (imf09.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 0F8AA140099 X-Stat-Signature: m4yqt9uegc6sxcwpa5apkuz65d3nr68d X-HE-Tag: 1652384600-551542 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 Thu, 12 May 2022 09:50:37 +0100 Mel Gorman wrote: > Changelog since v2 > o More conversions from page->lru to page->[pcp_list|buddy_list] > o Additional test results in changelogs > > Changelog since v1 > o Fix unsafe RT locking scheme > o Use spin_trylock on UP PREEMPT_RT > > 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 be cause a real-time s/may be/may/ > task runnning on a NOHZ_FULL CPU to miss a deadline and at minimum, s/nnn/nn/ > the draining in non-deterministic. s/n/s/;) > 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. The locking is inherently unsafe for remote access unless > the CPU is hot-removed. I don't understand the final sentence here. Which CPU and why does hot-removing it make the locking safe? > This series adjusts the locking. A spinlock is added to struct > per_cpu_pages to protect the list contents while local_lock_irq continues > to prevent migration and IRQ reentry. This allows a remote CPU to safely > drain a remote per-cpu list. > > This series is a partial series. Follow-on work should allow the > local_irq_save to be converted to a local_irq to avoid IRQs being > disabled/enabled in most cases. Consequently, there are some TODO comments > highlighting the places that would change if local_irq was used. However, > there are enough corner cases that it deserves a series on its own > separated by one kernel release and the priority right now is to avoid > interference of high priority tasks.