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 C88B0C43334 for ; Fri, 17 Jun 2022 07:57:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6B4836B0074; Fri, 17 Jun 2022 03:57:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6646A6B0075; Fri, 17 Jun 2022 03:57:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 52D6B6B0078; Fri, 17 Jun 2022 03:57:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 440C16B0074 for ; Fri, 17 Jun 2022 03:57:08 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 1D35D60811 for ; Fri, 17 Jun 2022 07:57:08 +0000 (UTC) X-FDA: 79586972136.03.A15D394 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf16.hostedemail.com (Postfix) with ESMTP id 9D9E718005F for ; Fri, 17 Jun 2022 07:57:07 +0000 (UTC) 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 ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=yIeosKyc; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=pjflmxhz; dmarc=none; spf=pass (imf16.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655452627; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=CIbGaD2Xgfeb6uOIFzrsQuZy1/dwLd9NUE5dLf1lMwo=; b=7O/8Poi72pPdHbk+JTwQCt1Td5YDEKtjmcyG4kCLyFSaLa+Phri/yqfsZg4LLn6o+QQA1K MKq/RrbfZ1KpN41RXc9D2w9l4KoE0DlSf9/IyDho32fpLPYZg9mxKiENX76HASnSQB4Gyu MDvWf3Nl1AQh1cUqaECAfMlE3m6sGuE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655452627; a=rsa-sha256; cv=none; b=8A0LFOs4d1oq/uV93gjkAwDRiXWRmhxBK2T75SmNSr6yD3pUnD6kU88XKppzkjFMXP6u3a KPWuSV5JS6cw0tAH7AOMeNjhgN01O5He2XVvGbD5tLcRJY0wyS1GpAwskckf9xjFzB3Cmy WsRo513Lgl+XdWjRxm2wbkztxWZgE6g= X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 9D9E718005F X-Rspam-User: Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=yIeosKyc; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=pjflmxhz; dmarc=none; spf=pass (imf16.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Stat-Signature: gdqz85jowp9efnwzbshnpp5strgksbd5 X-HE-Tag: 1655452627-264445 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 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.