Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp997588pxb; Tue, 17 Aug 2021 00:59:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoe7gbV3cl+6QOC0B5UFbTWYPtY83/m5rLRSLF1L2iHd8Bi7HcfvVv5zcxzYqTlqAyJllD X-Received: by 2002:a05:6638:148f:: with SMTP id j15mr1839180jak.61.1629187167452; Tue, 17 Aug 2021 00:59:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629187167; cv=none; d=google.com; s=arc-20160816; b=hRsuSYyDRqRsVaWBzJjj1lJ8E5LDqiVwh/9tBtuk+cRw9PBlVK8WuXl47983m0PBfU A+8dmwLVqrfGBP+0gV4udaSy522nB3TWzTjZWHtCXk1FGeifTHzky141+qqeI/J/u1nv JjnpO5WCs+d6fGHaZvJ98pDj0aU/Ob7uA3QiOtZ6jPI2AIfoUlybWSdLV6pn0B2uVLyA euWdDtRiHVbyO7GFtiSIl5JmO5/YLFrGLSnlhdh6sQxlg+nxFCD7UQrY5Bo0nUTMnQOF Xff4dgZetC6xR+vO6mAsYo6rLj5vzdtWhiczZz4Dns+vdxEJP7KgEjOSlWspKeuG8l9/ zymg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-signature; bh=BQSPMmgepRWx/W8lRpj8JNGzlpHUm8j9e1oI+oQVKoM=; b=iDU2PowAcjw3jtZqGmIASk23eY0EysF0xY9y1VtuoJ+aqfv9Muq1hIr3rCgs7PPrqv U3MnO4Dfx1nurVAK4AcmItXMJKj5+9iCVXPSaEIiGIx5WQuJNE2i6OP9RNXzWYFSxE+O mI9Mh2vdB6f7qciPvuNct+9H8OrMPpTB0Fz70wIcEZ+UH7cjD5uPORQnbTDJZRsG1Mst TysMFZfUriGpml9GtA18rCPDWWRq9TkXju/6bpNaRO2bCkOhf6CPEgwXpQfHPDR+cUNi bfoBemzJZT/p6Ck0V8ZbAO1bhzyfBOOey/LBJLEyhkjfBnJbqsZIyGJyCg9NcBXSbPpR wXWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=egDfmTWg; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r3si1707392ile.126.2021.08.17.00.59.09; Tue, 17 Aug 2021 00:59:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=egDfmTWg; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234493AbhHQH6X (ORCPT + 99 others); Tue, 17 Aug 2021 03:58:23 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:36948 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234446AbhHQH6X (ORCPT ); Tue, 17 Aug 2021 03:58:23 -0400 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 A054A2000E; Tue, 17 Aug 2021 07:57:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1629187069; 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=BQSPMmgepRWx/W8lRpj8JNGzlpHUm8j9e1oI+oQVKoM=; b=egDfmTWgjA58Lnzy1gjCq+fdRgXSTrAwfYeINkivcfOCTt8hL19vWspPbORZCIg1ywLpUQ Cqz9afwHSSxluPVibn8IppqgnDXlZPDS/39HFzASfM452nvUiPMmKR/lFvjKGNg/kcrtX1 Ni6vKmBSZALV/rEChZPaBI4VsxhDvJI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1629187069; 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=BQSPMmgepRWx/W8lRpj8JNGzlpHUm8j9e1oI+oQVKoM=; b=g9+tvvJprEwd+NmROQI0RtrEDKbuN2p+fsuMBMCBoGh5FNtR37fI13PUJw+WbG4nIEFwEX irBs6ylNj9y+QKAA== 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 4111A13DF4; Tue, 17 Aug 2021 07:57:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id HyfCDP1rG2GcNAAAMHmgww (envelope-from ); Tue, 17 Aug 2021 07:57:49 +0000 Subject: Re: [PATCH] mm, slub: add cpus_read_lock/unlock() for slab_mem_going_offline_callback() To: David Hildenbrand , qiang.zhang@windriver.com, akpm@linux-foundation.org, sfr@canb.auug.org.au Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210816074605.30336-1-qiang.zhang@windriver.com> From: Vlastimil Babka Message-ID: Date: Tue, 17 Aug 2021 09:57:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/16/21 10:04 AM, David Hildenbrand wrote: > On 16.08.21 09:46, qiang.zhang@windriver.com wrote: >> From: "Qiang.Zhang" >> >> The flush_all_cpus_locked() should be called with cpus_read_lock/unlock(), >> ensure flush_cpu_slab() can be executed on schedule_on CPU. >> >> Fixes: 1c84f3c91640 ("mm, slub: fix memory and cpu hotplug related lock ordering issues") > Memory notifiers are getting called from online_pages()/offline_pages(), > where we call memory_notify(MEM_GOING_OFFLINE, &arg) under > mem_hotplug_begin(). > > mem_hotplug_begin() does a cpus_read_lock(). Exactly. Also flush_all_cpus_locked() has a lockdep assert for cpus_read_lock() which doesn't trigger in testing. > How does this even work or against which branch is this? >