Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp936686imw; Tue, 5 Jul 2022 00:25:16 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v+PQPa3+7g+SYkNcfO2RuE/lLwA+vaAVW7+6rROXV4lijrSl1llbFKXGZqaHrfcOnDyzX/ X-Received: by 2002:a17:907:e92:b0:722:efe6:90fc with SMTP id ho18-20020a1709070e9200b00722efe690fcmr32734859ejc.44.1657005916087; Tue, 05 Jul 2022 00:25:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657005916; cv=none; d=google.com; s=arc-20160816; b=Vk41C9leNxgSXWPfkyFyoBXm80iDZ4dS/9aQG5T9Snii+LUTEHvdK/8S3yfWJrzjaf lux3M2dxWu8parAES7UMm/VsSyKEG4aaAED0maQVmUGLKZwE7Vj3gea4nll+TPLmPNqd Zo1eBHLTneqQUuLSl6IZ/r9skAWDeydXYvSzXYP9zqU5n0IB6WuLrEXv0O9AME3pBDLs 6DbeKRRnC6GOHr2FyG1j9fC2aKdc0AKeUnd4Jn3t29XiGbuYbTzG1H6kkklX6pfuONfO 8zzA24imo3DJD7Td7yKVm4Z+uQVhVE3tbc2ouaKt/E6R13SmL7wAz+LHJY5qu8hTxsYA 7wfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=jinIAMJlG84nS6PJafCD62pEB53qA007ABiJaLoV1fk=; b=tzsiU1I4h1Zjp9Ua6lbAFlh6MJDz58O73YIIuwIc75JhjynAvMnzTPB/QKhSCmHGeu 6tAG1qMQOLIIvxOw/5nllDsoT0367FKhEYcgdcrc1AApdwvybnFADvg9QPIJ59DwfjO8 s2BmP/DCZT5vzdPsx1D0S653G0zIYwpU+RNB9A8kfMyb6M92EdMPJZa3GcuYUQ7bB5a/ 3vXHuyuAiVN4mqIH7zc7+Sqf81mfH8kfvu/YKrXJezFMhKtAyFaE7Xr9foI8Ht6N52oU wcmX15MgACsoO5WnkJJsiShzR6jSFMcwh4+vjYdBDBVUR9jHTFZ3UxkxNldVfc2HOo+q JGkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v4-20020a056402348400b00435ba2f2402si13299197edc.19.2022.07.05.00.24.51; Tue, 05 Jul 2022 00:25:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230056AbiGEHUo (ORCPT + 99 others); Tue, 5 Jul 2022 03:20:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230034AbiGEHUk (ORCPT ); Tue, 5 Jul 2022 03:20:40 -0400 Received: from outbound-smtp24.blacknight.com (outbound-smtp24.blacknight.com [81.17.249.192]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44B73B487 for ; Tue, 5 Jul 2022 00:20:39 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp24.blacknight.com (Postfix) with ESMTPS id A3646C0C3B 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) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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