Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp170307iog; Fri, 17 Jun 2022 01:01:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1te3u5Kv2hNMyyRDR4aCk5urYhBzGSLwKnxUXmnNkzeJTBaar6uLpJ28t3/B1afK/onHAQr X-Received: by 2002:a05:6402:5412:b0:435:5997:ccb5 with SMTP id ev18-20020a056402541200b004355997ccb5mr5328372edb.167.1655452864296; Fri, 17 Jun 2022 01:01:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655452864; cv=none; d=google.com; s=arc-20160816; b=jJGOBHpAa30TvkxqNDRkzKZK8QCWH+WXBZcOwYq2+zkGX7ddcxNpH85BZTUIl0JKMh ZVA7e0FxMuNCLAtXljdIBum1EcAkjNkrQu3m/s4yDSUXHE6DWlA5OnX5Dl5hRlytFHcQ 3FKD8C5pxGpdXE1S27FG5SM6K7zkdbyrh/+Wj65xQoR3ac8iynWSLgaKpyziCYitHjpE UdLV3LyKLJqBR/CZEl5j1RtQBF28eZsJpM3wfl2lNAnNNBVuw3jvnk5P8nxNSff4g0jA wQfmAF1jA6W9S7vDOGKM4S6OBr5ktheOFJzjbJ04h/e3qPHxiderRUjKgcyxeQmbNjqu xLNA== 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=CIbGaD2Xgfeb6uOIFzrsQuZy1/dwLd9NUE5dLf1lMwo=; b=Ls4eZLP83x9TIqaixs03F/x20z3V5T29Q2456Q2sajUekRa6/gViJoL7qeSb95Npm6 mWdYD/woxK2mZTMh5GPUwLuOX/ff8BhUzJwNt8Tm4x/XQb2GfpoCrW76UAFplYgvy7DN /2ZPiJntfcR4kMQzuvRxmvCwd72UsH0sA4/EyNcKf2dT/tr92fRu+jpzxgVjQ5kPtH0H mAwcYjnVv2AEGnlJL3MQ/OoZEsKl/H28wZnbtwUNeLDVK3slcEqMB95ffmrwu3pMmzu0 q9ieHBEk8fTkxBg6lWeCUVQZAioiLt2ApOgA57FLW/gMGom5p/V3Ll2BEtliQHPswfpy uD3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=yIeosKyc; dkim=neutral (no key) header.i=@suse.cz header.b=pjflmxhz; 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 f17-20020a170906739100b007136091f4a5si3794406ejl.929.2022.06.17.01.00.34; Fri, 17 Jun 2022 01:01:04 -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=yIeosKyc; dkim=neutral (no key) header.i=@suse.cz header.b=pjflmxhz; 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 S1380688AbiFQH5W (ORCPT + 99 others); Fri, 17 Jun 2022 03:57:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380428AbiFQH5V (ORCPT ); Fri, 17 Jun 2022 03:57:21 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C642F50031 for ; Fri, 17 Jun 2022 00:57:20 -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-out1.suse.de (Postfix) with ESMTPS id 9C92E21DE9; Fri, 17 Jun 2022 07:57:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1655452626; 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=CIbGaD2Xgfeb6uOIFzrsQuZy1/dwLd9NUE5dLf1lMwo=; b=yIeosKycFcz7rNIG0abjA3KNArY11mINNn7nwjuwz5lO3duyy/3CU/dLR5be4+8vAJAOos 7DZdEVrR2m7LAAhlQ06S9cbuNx0/H5oOTpj6JvcdYcXHUWJi4QeRONTjQYFi826oQDQTvK 4KPppXMVuV/R6MlUd8qvq5CC2R7PLRA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1655452626; 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=CIbGaD2Xgfeb6uOIFzrsQuZy1/dwLd9NUE5dLf1lMwo=; b=pjflmxhzeNRFbILF8zLdikXBcvmT9/T0gkPUfERYG+ajCyUAynP7Vj3nJ/qgd7DuqVezdr zE2JzWDBk1OnXPAw== 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 797DE1348E; Fri, 17 Jun 2022 07:57:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id NBsSHdIzrGIpCAAAMHmgww (envelope-from ); Fri, 17 Jun 2022 07:57:06 +0000 Message-ID: <8354ba5b-d1ce-90c7-be76-328ab9321550@suse.cz> Date: Fri, 17 Jun 2022 09:57:06 +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 Cc: Mel Gorman , Andrew Morton , 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> <43033655-2e78-621b-cc76-c3dc53024d00@suse.cz> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.6 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 23:07, Yu Zhao wrote: > On Thu, Jun 16, 2022 at 11:02 AM Vlastimil Babka wrote: >> >> >> > @@ -3794,19 +3805,29 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone, >> > struct list_head *list; >> > struct page *page; >> > unsigned long flags; >> > + unsigned long __maybe_unused UP_flags; >> > >> > - local_lock_irqsave(&pagesets.lock, flags); >> > + /* >> > + * spin_trylock_irqsave is not necessary right now as it'll only be >> > + * true when contending with a remote drain. It's in place as a >> > + * preparation step before converting pcp locking to spin_trylock >> > + * to protect against IRQ reentry. >> > + */ >> > + pcp_trylock_prepare(UP_flags); >> > + pcp = pcp_spin_trylock_irqsave(zone->per_cpu_pageset, flags); >> > + if (!pcp) >> >> Besides the missing unpin Andrew fixed, I think also this is missing >> pcp_trylock_finish(UP_flags); ? > > spin_trylock only fails when trylock_finish is a NOP. True, so it's not an active bug, but I would still add it, so it's not confusing and depending on non-obvious details that might later change and break the code.