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 38214C433EF for ; Tue, 5 Jul 2022 07:20:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 67AF56B0071; Tue, 5 Jul 2022 03:20:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6284B6B0073; Tue, 5 Jul 2022 03:20:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4F03D6B0074; Tue, 5 Jul 2022 03:20:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 3C4016B0071 for ; Tue, 5 Jul 2022 03:20:40 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id CFE113257D for ; Tue, 5 Jul 2022 07:20:39 +0000 (UTC) X-FDA: 79652198598.08.DA5AAE4 Received: from outbound-smtp24.blacknight.com (outbound-smtp24.blacknight.com [81.17.249.192]) by imf17.hostedemail.com (Postfix) with ESMTP id 4186140028 for ; Tue, 5 Jul 2022 07:20:39 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp24.blacknight.com (Postfix) with ESMTPS id 957BAC0C1E for ; Tue, 5 Jul 2022 08:20:37 +0100 (IST) Received: (qmail 23578 invoked from network); 5 Jul 2022 07:20:37 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.198.246]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 5 Jul 2022 07:20:37 -0000 Date: Tue, 5 Jul 2022 08:20:34 +0100 From: Mel Gorman To: Vlastimil Babka Cc: Andrew Morton , Nicolas Saenz Julienne , Marcelo Tosatti , Michal Hocko , Hugh Dickins , Yu Zhao , Marek Szyprowski , LKML , Linux-MM Subject: Re: [PATCH 5/7] mm/page_alloc: Protect PCP lists with a spinlock Message-ID: <20220705072034.GC27531@techsingularity.net> References: <20220624125423.6126-1-mgorman@techsingularity.net> <20220624125423.6126-6-mgorman@techsingularity.net> <5f464a89-91b4-f432-99a9-45968fc80631@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <5f464a89-91b4-f432-99a9-45968fc80631@suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657005639; 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; bh=jinIAMJlG84nS6PJafCD62pEB53qA007ABiJaLoV1fk=; b=X1AAEdoPQ8IvbkWCIqXloTmJzURU7pznlESZVCgO1DZqKDSI5M+O7u6Vb9lT7ncbjTe+iP ccshe7MxRm/jzOLooUghT2u9jRgJ4+jwguuG3y8er6ou66lODAvXdCuCvX+6zbVmOoqgqK UWb8PVhK1BjD3RfdnkYefoB19GUaXkM= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf17.hostedemail.com: domain of mgorman@techsingularity.net designates 81.17.249.192 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657005639; a=rsa-sha256; cv=none; b=QjwdBnrAFHVH2zI/Ui6a7s8c8X/GiqeOrAh5VjQJuM68rBSOzd8yZMFQETdCS3PZrXEhGR BTfB1OhaOB91gRIM5I+MAJu2SnkYHas0At08faPZ9bMT3UeMwe6TVNbZswyt8ruMkaZo4I txF+Ac3UvUd+UrHqs+AEHsnKPWrW/Ro= Authentication-Results: imf17.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf17.hostedemail.com: domain of mgorman@techsingularity.net designates 81.17.249.192 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 4186140028 X-Stat-Signature: gxjpttib1y3hjsw74udfnjsojtbwr5br X-Rspam-User: X-HE-Tag: 1657005639-552499 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 Mon, Jul 04, 2022 at 02:31:17PM +0200, Vlastimil Babka wrote: > On 6/24/22 14:54, Mel Gorman wrote: > > Currently the PCP lists are protected by using local_lock_irqsave to > > prevent migration and IRQ reentrancy but this is inconvenient. Remote > > draining of the lists is impossible and a workqueue is required and every > > task allocation/free must disable then enable interrupts which is > > expensive. > > > > As preparation for dealing with both of those problems, protect the lists > > with a spinlock. The IRQ-unsafe version of the lock is used because IRQs > > are already disabled by local_lock_irqsave. spin_trylock is used in > > preparation for a time when local_lock could be used instead of > > lock_lock_irqsave. > > ^ local_lock_irqsave? > More appropriate given how the series evolved would be; spin_trylock is used in combination with local_lock_irqsave() but later will be replaced with a spin_trylock_irqsave when the local_lock is removed. -- Mel Gorman SUSE Labs