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 X-Spam-Level: X-Spam-Status: No, score=-8.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21E0FC433FE for ; Fri, 3 Sep 2021 07:03:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A5F64610CE for ; Fri, 3 Sep 2021 07:03:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A5F64610CE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 41AB4900002; Fri, 3 Sep 2021 03:03:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3CB0D8D0001; Fri, 3 Sep 2021 03:03:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2930C900002; Fri, 3 Sep 2021 03:03:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0080.hostedemail.com [216.40.44.80]) by kanga.kvack.org (Postfix) with ESMTP id 1A13D8D0001 for ; Fri, 3 Sep 2021 03:03:58 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id D4DC12D019 for ; Fri, 3 Sep 2021 07:03:57 +0000 (UTC) X-FDA: 78545372514.30.2680947 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf03.hostedemail.com (Postfix) with ESMTP id 6D14B30000A4 for ; Fri, 3 Sep 2021 07:03:57 +0000 (UTC) Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (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 17FA9221B3; Fri, 3 Sep 2021 07:03:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1630652636; 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=CAm+yUedEll3+jHg2E06Q7Z+88FC6ohCxlncYCLEcyU=; b=WefZjKOf+O9R18/jcRSs0PCVxvgnLWzPaWetD+9iY5KHvqGVrllQ2zFCDS/X2C/HPjQUIt xP8nj1eNCPObzunyJPHy+wZNQPLahb3L8S87J0gO1EjTtStUrdMhM9IxdSc4yaFTpWADKC LztSCUNKtOWVXRm2EMQ1qBuKdydQoPg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1630652636; 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=CAm+yUedEll3+jHg2E06Q7Z+88FC6ohCxlncYCLEcyU=; b=NS/PJbwHl+g9xNqobzNEW8v9Xcwt2keS7cA5ECHqmnDtRtq6MMAl00aV6ZIL7zGOJPSPKU 0fztORjoehoRFgDg== Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (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 imap1.suse-dmz.suse.de (Postfix) with ESMTPS id AD260136BF; Fri, 3 Sep 2021 07:03:55 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id M8n3KNvIMWFgXAAAGKfGzw (envelope-from ); Fri, 03 Sep 2021 07:03:55 +0000 Message-ID: <4d2bdf47-618e-40cd-d7c2-4a06a4b28335@suse.cz> Date: Fri, 3 Sep 2021 09:03:55 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.0.3 Subject: Re: [patch 036/212] mm, slab: make flush_slab() possible to call with irqs enabled Content-Language: en-US To: Mike Galbraith , Linus Torvalds , Andrew Morton Cc: Sebastian Andrzej Siewior , Jesper Dangaard Brouer , Christoph Lameter , Joonsoo Kim , Jann Horn , Linux-MM , Mel Gorman , mm-commits@vger.kernel.org, Pekka Enberg , David Rientjes , Thomas Gleixner References: <20210902144820.78957dff93d7bea620d55a89@linux-foundation.org> <20210902215152.ibWfL_bvd%akpm@linux-foundation.org> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=WefZjKOf; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="NS/PJbwH"; dmarc=none; spf=pass (imf03.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 6D14B30000A4 X-Stat-Signature: btoaphxhfcoohtb1s4bjnjwqoii6r99d X-HE-Tag: 1630652637-766487 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 9/3/21 08:22, Mike Galbraith wrote: >> > so that when you read that function on its own, it's clear that the >> > lock is always held over that critical section - and the issue is that >> > perhaps the lock was already taken by the caller. >> >> Actually that "already taken" becomes "caller does not need it/can't Meant to say "... later in the series becomes ...". >> even take the local lock as it's not local" (it's a cpu hot remove >> handler on behalf of another, dead cpu). >> >> So would it work with something like the following cleanup on top later >> after proper testing? (now just compile tested). > > To my eyeballs, below duplication of a couple lines of initialization > needed by the lockless function is less icky than the double return. Yeah, that's better, thanks Mike.