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 1AF37C433EF for ; Mon, 6 Dec 2021 14:15:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 82AE36B006C; Mon, 6 Dec 2021 09:15:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7D9D26B0071; Mon, 6 Dec 2021 09:15:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A3546B0072; Mon, 6 Dec 2021 09:15:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0095.hostedemail.com [216.40.44.95]) by kanga.kvack.org (Postfix) with ESMTP id 5CE3E6B006C for ; Mon, 6 Dec 2021 09:15:14 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 1DBE78249980 for ; Mon, 6 Dec 2021 14:15:04 +0000 (UTC) X-FDA: 78887566128.27.B745555 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf05.hostedemail.com (Postfix) with ESMTP id A54EC100005 for ; Mon, 6 Dec 2021 14:15:03 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 7A3661FD2F; Mon, 6 Dec 2021 14:15:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1638800102; 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=XUY/UyOeKFEZfPRGMjkBZxE12vtUkgWPWiPVpNmMnWY=; b=Ilo/wDTNiUqj6PF8yzwZ3MC/vXXF1PEmwwVB6nIj5wQA4PaS7Tpc/qxpxIMCgv+NjaIMir EV5N7TqMpADOEzdvfch9hT4t/kQgKBTijU1Jh1Ywnc80neFrAWDFx3UD43J+tZfwXYuUdu SxVEh3mACOt0mAMOl6n+cgR7przCFy0= 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 39420A3B83; Mon, 6 Dec 2021 14:15:02 +0000 (UTC) Date: Mon, 6 Dec 2021 15:15:01 +0100 From: Michal Hocko To: David Hildenbrand Cc: Nico Pache , linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, shakeelb@google.com, ktkhai@virtuozzo.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> <840cb3d0-61fe-b6cb-9918-69146ba06cf7@redhat.com> <51c65635-1dae-6ba4-daf9-db9df0ec35d8@redhat.com> <05157de4-e5df-11fc-fc46-8a9f79d0ddb4@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <05157de4-e5df-11fc-fc46-8a9f79d0ddb4@redhat.com> X-Rspamd-Queue-Id: A54EC100005 Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b="Ilo/wDTN"; spf=pass (imf05.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-Rspamd-Server: rspam04 X-Stat-Signature: pg9xyn3zmhxye9xj9geg3m8o7z5hbd5h X-HE-Tag: 1638800103-333780 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 14:47:13, David Hildenbrand wrote: > On 06.12.21 14:06, Michal Hocko wrote: [...] > > This is certainly possible. But it a) adds a branch to the hotpath and > > b) it doesn't solve any other potential dereference of garbage node. > > I don't think a) is a problem but it's easy to measure. Let me just clarify on this one. This single particular branch will be indeed hard to match to any performance changes. On a single call of the allocator it is nothing. But it is a condition that will be executed by each caller while it won't ever trigger in most systems and workloads. In other words it will cause a lot of wasted cpu cycles long term. A more expensive one time initialization is worth in order to have allocator fast path lighter IMHO. -- Michal Hocko SUSE Labs