Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp51739pxy; Tue, 20 Apr 2021 20:15:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhVDEW3066rMi6ztgqR0Aa6ATMOIkpLmQTlElQIoPAFONcDBiAtTl2OGI+Bt2maQUJf3IZ X-Received: by 2002:a05:6a00:162c:b029:22b:4491:d63a with SMTP id e12-20020a056a00162cb029022b4491d63amr28504814pfc.28.1618974928991; Tue, 20 Apr 2021 20:15:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618974928; cv=none; d=google.com; s=arc-20160816; b=USoIFaIZdag8wXfS28HXo1qOupXHv7eRzyQWz+ErWhzHeeZ7YfXibE3C7Q2NLk8kph lgeEcvg6p/o09svuA4GFs0GDH+pAeIhEQS0VWuQXko/l7g7V+Db7ArCiYSfmlY6KArVW L7Akiyx/GvqCx5ltXEp1oHZtH4aM26RkEGG7eFjFQSF5hxpQV05Qld/bl9rj5qHeXTHb nCg1tkAT/r6gIFYzi2adnqyZxu/OvlQFycdn2twIkSlONAIfF8svZCFHCXPSzQF/MTDp DuLkPlsZpKQ3HC0TmmtK0a1L/NT4CVVCzBPh4cdli2SwvXabeBQFBD2YywM6IkLfuwvw HhvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GBQ0Smm8mdFKrkAGvpD/jxSPjc9gT7AqBW1h5E5t9V8=; b=nCQPUvxoPGxCf8HqgJRdf2HIAtjvNNVIhu9o1rFuxp4BFASu+iDdgnFd85zyWgQBdt 7vv0EI7Vxe+FOlfuX9V1TMqBwSkQFsfM0OjBuFOLRydFQF3SCsbG5yYbjBXnSxDIsIMD AccpO4/TQ4Ap+larzGs8Kzkkj1KKCtFtba42EBDjckWVQa6cq5+YF8ao3VBjQoFNofzU yZwhk27Yk/ozYo64vO3+4QyjVoZKVVOuNQTg086j4FMqHjF8rbbNtjAzynKlXiiTINGI tqKWBPbXUf2gVXXU2GM7Ao23P0WZw78PrJ86Nik9otGBxcKl5B1VSLoH2AWU9ojwUgFS j69A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=f4nKLJY7; 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 hg14si998144pjb.133.2021.04.20.20.15.17; Tue, 20 Apr 2021 20:15:28 -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=@infradead.org header.s=casper.20170209 header.b=f4nKLJY7; 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 S234692AbhDUDLb (ORCPT + 99 others); Tue, 20 Apr 2021 23:11:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233982AbhDUDLa (ORCPT ); Tue, 20 Apr 2021 23:11:30 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 447E0C06174A for ; Tue, 20 Apr 2021 20:10:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=GBQ0Smm8mdFKrkAGvpD/jxSPjc9gT7AqBW1h5E5t9V8=; b=f4nKLJY7BiD/O7OPYWGbEvaO11 dQifrrQ/3lAJxNEXQnNoiJBh7GVRQ+SpcjY+VXBoW+pwziMgZzV5yhcNXKFnCnQAoDzwDXXg+zGwL 1kC4kWNS98BbjtIn8fD9uWJCc0D5PVc1EYyVVTk9leaJ5nSOBz7NPuVjFRcUhpAIxaouubbUIPUfr rjjcz8TMgoojom3AkvZFcgUfaYWOEe2NCGUWRMb9KWMOkoXaA+ShYf7c0NYhb1y9WknJXglSyGPp0 wsKX56br5dvPm1e1q+MfNVFOxMIQJTuEPZ3UvgL52IkYkjuaZAvluYUW34O5Ctph7tUDqvNlRau2s 1FIl5K9A==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lZ3Fr-00FyyG-W8; Wed, 21 Apr 2021 03:10:23 +0000 Date: Wed, 21 Apr 2021 04:10:19 +0100 From: Matthew Wilcox To: Yejune Deng Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, vbabka@suse.cz, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/slab.c: use 'ac' from the caller Message-ID: <20210421031019.GF3596236@casper.infradead.org> References: <20210421022518.67451-1-yejune.deng@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210421022518.67451-1-yejune.deng@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 21, 2021 at 10:25:17AM +0800, Yejune Deng wrote: > @@ -3045,12 +3044,7 @@ static inline void *____cache_alloc(struct kmem_cache *cachep, gfp_t flags) > } > > STATS_INC_ALLOCMISS(cachep); > - objp = cache_alloc_refill(cachep, flags); > - /* > - * the 'ac' may be updated by cache_alloc_refill(), > - * and kmemleak_erase() requires its correct value. > - */ > - ac = cpu_cache_get(cachep); > + objp = cache_alloc_refill(cachep, ac, flags); I think passing 'ac' in is fine (probably? I don't know this code deeply), but deleting this call to 'ac' is clearly wrong. The comment even tells you that! I just verified the code, and the comment is correct.