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 EDEF0C433EF for ; Tue, 21 Jun 2022 09:27:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8DF256B0075; Tue, 21 Jun 2022 05:27:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 88F5C6B0078; Tue, 21 Jun 2022 05:27:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 77F956B007B; Tue, 21 Jun 2022 05:27:32 -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 68C426B0075 for ; Tue, 21 Jun 2022 05:27:32 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 3D21BEB4 for ; Tue, 21 Jun 2022 09:27:32 +0000 (UTC) X-FDA: 79601715144.30.53D79D2 Received: from outbound-smtp02.blacknight.com (outbound-smtp02.blacknight.com [81.17.249.8]) by imf05.hostedemail.com (Postfix) with ESMTP id BECBA10009A for ; Tue, 21 Jun 2022 09:27:31 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp02.blacknight.com (Postfix) with ESMTPS id A4E10BACC3 for ; Tue, 21 Jun 2022 10:27:30 +0100 (IST) Received: (qmail 7506 invoked from network); 21 Jun 2022 09:27:30 -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); 21 Jun 2022 09:27:30 -0000 Date: Tue, 21 Jun 2022 10:27:28 +0100 From: Mel Gorman To: Vlastimil Babka Cc: Yu Zhao , Andrew Morton , Nicolas Saenz Julienne , Marcelo Tosatti , Michal Hocko , Hugh Dickins , LKML , Linux-MM Subject: Re: [PATCH 7/7] mm/page_alloc: Replace local_lock with normal spinlock Message-ID: <20220621092728.GE15453@techsingularity.net> References: <20220613125622.18628-1-mgorman@techsingularity.net> <20220613125622.18628-8-mgorman@techsingularity.net> <43033655-2e78-621b-cc76-c3dc53024d00@suse.cz> <8354ba5b-d1ce-90c7-be76-328ab9321550@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <8354ba5b-d1ce-90c7-be76-328ab9321550@suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655803651; a=rsa-sha256; cv=none; b=MhynT+0etnBYIzCfmUzIGN5dfXi58M7/8wtkWnfMoc3dGlFlxEMXetbFoeLEAMzGttxunn 8q7DFbrSIqRuYGtApWSRk0SzGuSZCnrr91mf+eXY+Qo0m1iqgMDFEAiuiEINB0pqnGXjzp 1NawcsiqM7kczJjtpYmm7VpNJmZ8FvY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655803651; 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=vDZ4GXiPRXCENkGYCnV9I/7G2c6VByhbNrd+uG4xkbw=; b=GEfhsvoiZL2DDw5qxT+WA4ioOxmM6tLOZ1XPeDi62Vog0EcQaQG04jXhdoUhx87ydeU0AY PtmbOaEvNCJTf42ffZGUf9CZfL5ur8riZW6LMpucYjYqev1Td/BBpfqx1r4KJgh7NCI+vO AXIULtJv4mElxbSrA0rCySQa2foHq/o= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf05.hostedemail.com: domain of mgorman@techsingularity.net designates 81.17.249.8 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net Authentication-Results: imf05.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf05.hostedemail.com: domain of mgorman@techsingularity.net designates 81.17.249.8 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: BECBA10009A X-Stat-Signature: ewfb1sb98py6fw44xza5uxou3xf3nq4c X-HE-Tag: 1655803651-35199 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 Fri, Jun 17, 2022 at 09:57:06AM +0200, Vlastimil Babka wrote: > 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. Yes. Even though it may work, it's still wrong. -- Mel Gorman SUSE Labs