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 C786AC433EF for ; Mon, 6 Dec 2021 13:25:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 91D9B6B007D; Mon, 6 Dec 2021 08:24:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8CC1E6B007E; Mon, 6 Dec 2021 08:24:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7BB996B0080; Mon, 6 Dec 2021 08:24:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0062.hostedemail.com [216.40.44.62]) by kanga.kvack.org (Postfix) with ESMTP id 6EF676B007D for ; Mon, 6 Dec 2021 08:24:53 -0500 (EST) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 372628249980 for ; Mon, 6 Dec 2021 13:24:43 +0000 (UTC) X-FDA: 78887439246.05.505CDCF Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf02.hostedemail.com (Postfix) with ESMTP id 9BC3A80008 for ; Mon, 6 Dec 2021 13:24:42 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 42A081FD34; Mon, 6 Dec 2021 13:24:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1638797081; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OsJpugZkIxlDMOGsFKVTdzYlQKPvibTQJW7zZ8AbbHg=; b=hqMHgMDE1Ioxj4vSVtoNzXs6ePkc24zeePGiC3Xdj4ASedrDZYrM/CiUlbZDZgWuuI2apW nankjPJIPDhrVMN4M1aRleZ6DKEV+9u5OcYb0RD4KaqqV211OkUKM4YYk22yBwWdQjvbnF l1icbQYi/ZkrBlqZtHNlNqAIvMrDyGc= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 0D214A3B88; Mon, 6 Dec 2021 13:24:41 +0000 (UTC) Date: Mon, 6 Dec 2021 14:24:40 +0100 From: Michal Hocko To: Kirill Tkhai Cc: David Hildenbrand , Nico Pache , linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, shakeelb@google.com, shy828301@gmail.com, guro@fb.com, vbabka@suse.cz, vdavydov.dev@gmail.com, raquini@redhat.com Subject: Re: [RFC PATCH 2/2] mm/vmscan.c: Prevent allocating shrinker_info on offlined nodes Message-ID: References: <20211206033338.743270-1-npache@redhat.com> <20211206033338.743270-3-npache@redhat.com> <24b4455c-aff9-ca9f-e29f-350833e7a0d1@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <24b4455c-aff9-ca9f-e29f-350833e7a0d1@virtuozzo.com> X-Stat-Signature: 8u5yw54f4j3rqzjp7rcm94rfwd1c5xjp Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=hqMHgMDE; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf02.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 9BC3A80008 X-HE-Tag: 1638797082-278106 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 Mon 06-12-21 16:19:12, Kirill Tkhai wrote: > On 06.12.2021 13:45, David Hildenbrand wrote: > >> This doesn't seen complete. Slab shrinkers are used in the reclaim > >> context. Previously offline nodes could be onlined later and this would > >> lead to NULL ptr because there is no hook to allocate new shrinker > >> infos. This would be also really impractical because this would have to > >> update all existing memcgs... > > > > Instead of going through the trouble of updating... > > > > ... maybe just keep for_each_node() and check if the target node is > > offline. If it's offline, just allocate from the first online node. > > After all, we're not using __GFP_THISNODE, so there are no guarantees > > either way ... > > Hm, can't we add shrinker maps allocation to __try_online_node() in addition > to this patch? Either that or through hotplug notifier (which would be a better solution). But allocating a new shrinker map for each memcg would have to be done as has been mentioned earlier. -- Michal Hocko SUSE Labs