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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49357C77B7E for ; Sat, 27 May 2023 15:07:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232701AbjE0PHg (ORCPT ); Sat, 27 May 2023 11:07:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230375AbjE0PHe (ORCPT ); Sat, 27 May 2023 11:07:34 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2868E3; Sat, 27 May 2023 08:07:31 -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-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=loxo3o+bCByV7kuxO8tBvwlfDa2341F3CpYgMrLNBcA=; b=AfN7nBhiA+MsFKTyviECPRCgZG cji0YDU+jsr87bzmrt10rBcc5NwzjUiNNHINgZV0FeQHCeGKL5PbmI58kQ4wXUPyt7BowsndH05J6 vKhMd5kdVYhYAWwpr0q7dKn8UFbYqtB8mI9fdOHj9An/K0TpwcUTJ3mrd/HVS5FrPvVOaP7D2Y58s HObFa4n4setAY/vRQ5EfL84Rxi1iHLQJUifvZITYUBUrgPNgJGdQ3Q7uNnMLlwahFqDYCX5Lu3TTB /1I8RtvxvQRzAUggbAKizv5koVTqUxkvB18EED/l6BseB9iOZQKTQoCymtfBPiewYHl9D1g78AU4M yUosG5fg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1q2vVc-003tkD-Mr; Sat, 27 May 2023 15:07:08 +0000 Date: Sat, 27 May 2023 16:07:08 +0100 From: Matthew Wilcox To: Yosry Ahmed Cc: Miaohe Lin , Vasily Averin , hannes@cmpxchg.org, mhocko@kernel.org, roman.gushchin@linux.dev, shakeelb@google.com, akpm@linux-foundation.org, muchun.song@linux.dev, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] memcg: remove unused mem_cgroup_from_obj() Message-ID: References: <20230527103126.398267-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 26, 2023 at 09:13:05PM -0700, Yosry Ahmed wrote: > On Fri, May 26, 2023 at 9:01 PM Matthew Wilcox wrote: > > > > On Sat, May 27, 2023 at 06:31:26PM +0800, Miaohe Lin wrote: > > > The function mem_cgroup_from_obj() is not used anymore. Remove it and > > > clean up relevant comments. > > > > You should have looked at the git history to see why it was created > > and who used it. > > > > Shakeel, Vasily, are you going to retry adding commit 1d0403d20f6c? > > That commit did not introduce the function though, no? It was > introduced before it and replaced by other variants over time (like > mem_cgroup_from_slab_obj()). It looks like that commit was reverted ~9 > months ago. We can always bring it back if/when needed. The commit immediately preceding it is fc4db90fe71e. Of course we can bring it back. It's just code. But avoiding unnecessary churn is also good. Let's wait to hear from Vasily. > It also looks to me that 1d0403d20f6c was using mem_cgroup_from_obj() > on a struct net object, which is allocated in net_alloc() from a slab > cache, so mem_cgroup_from_slab_obj() should be sufficient, no? Clearly not. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Subject: Re: [PATCH] memcg: remove unused mem_cgroup_from_obj() Date: Sat, 27 May 2023 16:07:08 +0100 Message-ID: References: <20230527103126.398267-1-linmiaohe@huawei.com> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Return-path: DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=loxo3o+bCByV7kuxO8tBvwlfDa2341F3CpYgMrLNBcA=; b=AfN7nBhiA+MsFKTyviECPRCgZG cji0YDU+jsr87bzmrt10rBcc5NwzjUiNNHINgZV0FeQHCeGKL5PbmI58kQ4wXUPyt7BowsndH05J6 vKhMd5kdVYhYAWwpr0q7dKn8UFbYqtB8mI9fdOHj9An/K0TpwcUTJ3mrd/HVS5FrPvVOaP7D2Y58s HObFa4n4setAY/vRQ5EfL84Rxi1iHLQJUifvZITYUBUrgPNgJGdQ3Q7uNnMLlwahFqDYCX5Lu3TTB /1I8RtvxvQRzAUggbAKizv5koVTqUxkvB18EED/l6BseB9iOZQKTQoCymtfBPiewYHl9D1g78AU4M yUosG5fg==; Content-Disposition: inline In-Reply-To: List-ID: Content-Type: text/plain; charset="windows-1252" To: Yosry Ahmed Cc: Miaohe Lin , Vasily Averin , hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org, mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, roman.gushchin-fxUVXftIFDnyG1zEObXtfA@public.gmane.org, shakeelb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org, muchun.song-fxUVXftIFDnyG1zEObXtfA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On Fri, May 26, 2023 at 09:13:05PM -0700, Yosry Ahmed wrote: > On Fri, May 26, 2023 at 9:01=E2=80=AFPM Matthew Wilcox wrote: > > > > On Sat, May 27, 2023 at 06:31:26PM +0800, Miaohe Lin wrote: > > > The function mem_cgroup_from_obj() is not used anymore. Remove it and > > > clean up relevant comments. > > > > You should have looked at the git history to see why it was created > > and who used it. > > > > Shakeel, Vasily, are you going to retry adding commit 1d0403d20f6c? >=20 > That commit did not introduce the function though, no? It was > introduced before it and replaced by other variants over time (like > mem_cgroup_from_slab_obj()). It looks like that commit was reverted ~9 > months ago. We can always bring it back if/when needed. The commit immediately preceding it is fc4db90fe71e. Of course we can bring it back. It's just code. But avoiding unnecessary churn is also good. Let's wait to hear from Vasily. > It also looks to me that 1d0403d20f6c was using mem_cgroup_from_obj() > on a struct net object, which is allocated in net_alloc() from a slab > cache, so mem_cgroup_from_slab_obj() should be sufficient, no? Clearly not.