Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp170191iog; Fri, 17 Jun 2022 01:00:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sXHFmdMLb/TivNVd0nvfKx7+udQCzsy1VZbWe4vteUTwCX773ll1eA+UBL+eq/ikeRBrC1 X-Received: by 2002:a17:906:685:b0:6fa:8e17:e9b5 with SMTP id u5-20020a170906068500b006fa8e17e9b5mr8377608ejb.522.1655452855538; Fri, 17 Jun 2022 01:00:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655452855; cv=none; d=google.com; s=arc-20160816; b=dKdL7LLFUPfF5vAWBDlYQYS1qDydG19/a+cSuopXB9CiEDpJPrquxOJkBt5a7zmop3 QIq7dzflQ6Ff2+HJRXtgDRjKyvZbyH0/Iax1ZNilqa4t3AwaVU9/VPcYta9vJkJ7s8H8 KAvzlWf3W5SOf1hubqyX8FSVBDsPi9v4Uc90PYUZcBUGYl7T+GZFP+HbmMR3kC5CL9js 4utOjzJmv0RrHJ7eDKRQPHkujMbp1PtYYi3NNdI4b9DopA522HGyxAnxuedzgXKt+YAs J9zoE89pZw3JnJSUptJpWUakWpafIsqE3ESCXIew0HmkNHIqyeKrpdACm8LdrdYDYlKF oo0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=/8399TE5UWPTJshsgNjQyi05ualfu0JSvUA5o+5dodo=; b=lQvFIlU6/YCv+h7MhHOTIAjQPVzIn41NV1uY6GZewRHX/A8QYBQSRLJHxkeMLw1sxA 4jHyVFmegpRBHnS0oWNkX8DYX4TxAUy3NHxgrGmKySmGEEa0ntF6n2fVUG/acwZVe+UT un8z+fG4Ya+cSmwhOHf/r8hTpn5L2qw28c6CMIYVcbv3sm1vlmS0J8jg3B/iZci2yC9K qoxpjZe7umliH15asDsQ1CIQxLjnI3B4TNWa3iMZUlDHHadsLGyeSd6lqrVjtrZP5F/m Vjw5igNGlJ7isgaTC/m1xaJix9UMK/qnUmbrwk4JzCz/g24fpILvdEG4jJ7m9VqU7xzd inUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=YhAaqPEm; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 hr16-20020a1709073f9000b006ff22be82f4si4594343ejc.61.2022.06.17.01.00.27; Fri, 17 Jun 2022 01:00:55 -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; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=YhAaqPEm; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 S1380597AbiFQHzl (ORCPT + 99 others); Fri, 17 Jun 2022 03:55:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379797AbiFQHzk (ORCPT ); Fri, 17 Jun 2022 03:55:40 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4000942EFE for ; Fri, 17 Jun 2022 00:55:39 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id EA3CA1FD8E; Fri, 17 Jun 2022 07:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1655452537; h=from:from:reply-to: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; bh=/8399TE5UWPTJshsgNjQyi05ualfu0JSvUA5o+5dodo=; b=YhAaqPEmN8n85x5VzOQsIZO2VOldEli/7FcoIwOZqIqmhGIq7IPCQxhQu2yd97txGaqUH6 P0nHPwylWBSMKLDat0uHIE+/4oJr3KLP3VSmiYeLWgd28q/u9TNVrIB4wQjFxSHltkPOLs /antEabR+8LN/u1/l/rj1xQWWExV8jc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1655452537; h=from:from:reply-to: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; bh=/8399TE5UWPTJshsgNjQyi05ualfu0JSvUA5o+5dodo=; b=9vX/bCMnYg+czHiISNbVsUow0+sQpofd2GmtiCLWyel7gw82WOJlgDyOJnFkPkAH9jXGs1 umTJMRTR8OjtRBCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BE8FA1348E; Fri, 17 Jun 2022 07:55:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id zAC3LXkzrGKhBwAAMHmgww (envelope-from ); Fri, 17 Jun 2022 07:55:37 +0000 Message-ID: <81d2df40-c955-b88d-e29f-7f09796f5deb@suse.cz> Date: Fri, 17 Jun 2022 09:55:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH 7/7] mm/page_alloc: Replace local_lock with normal spinlock Content-Language: en-US To: Yu Zhao , Andrew Morton Cc: Marek Szyprowski , Mel Gorman , Nicolas Saenz Julienne , Marcelo Tosatti , Michal Hocko , Hugh Dickins , LKML , Linux-MM References: <20220613125622.18628-1-mgorman@techsingularity.net> <20220613125622.18628-8-mgorman@techsingularity.net> <20220615160446.be1f75fd256d67e57b27a9fc@linux-foundation.org> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, 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 6/16/22 05:05, Yu Zhao wrote: > On Wed, Jun 15, 2022 at 04:04:46PM -0700, Andrew Morton wrote: > > While we are at it, please consider this cleanup: I suspect Mel had further plans for the API beynd this series. ... > #define pcp_spin_trylock_irqsave(ptr, flags) \ > - pcpu_spin_trylock_irqsave(struct per_cpu_pages, lock, ptr, flags) > - > -#define pcp_spin_unlock(ptr) \ > - pcpu_spin_unlock(lock, ptr) > +({ \ > + struct per_cpu_pages *_ret; \ > + pcpu_task_pin(); \ > + _ret = this_cpu_ptr(ptr); \ > + if (!spin_trylock_irqsave(&_ret->lock, flags)) \ Also missing the unpin? > + _ret = NULL; \ > + _ret; \ > +}) > > #define pcp_spin_unlock_irqrestore(ptr, flags) \ > - pcpu_spin_unlock_irqrestore(lock, ptr, flags) > +({ \ > + spin_unlock_irqrestore(&ptr->lock, flags); \ > + pcpu_task_unpin(); \ > +}) > + > #ifdef CONFIG_USE_PERCPU_NUMA_NODE_ID > DEFINE_PER_CPU(int, numa_node); > EXPORT_PER_CPU_SYMBOL(numa_node); > @@ -3488,7 +3458,7 @@ void free_unref_page(struct page *page, unsigned int order) > > zone = page_zone(page); > pcp_trylock_prepare(UP_flags); > - pcp = pcpu_spin_trylock_irqsave(struct per_cpu_pages, lock, zone->per_cpu_pageset, flags); > + pcp = pcp_spin_trylock_irqsave(zone->per_cpu_pageset, flags); > if (pcp) { > free_unref_page_commit(pcp, zone, page, migratetype, order); > pcp_spin_unlock_irqrestore(pcp, flags);