* [PATCH v1] mm: Defines obj_cgroup_get() if CONFIG_MEMCG is not defined.
@ 2024-08-20 19:50 Kanchana P Sridhar
2024-08-21 15:11 ` Michal Hocko
2024-08-21 19:24 ` Nhat Pham
0 siblings, 2 replies; 7+ messages in thread
From: Kanchana P Sridhar @ 2024-08-20 19:50 UTC (permalink / raw)
To: linux-kernel, linux-mm, hannes, yosryahmed, nphamcs,
ryan.roberts, ying.huang, 21cnbao, akpm
Cc: nanhai.zou, wajdi.k.feghali, vinodh.gopal, kanchana.p.sridhar
This resolves an issue with obj_cgroup_get() not being defined
if CONFIG_MEMCG is not defined. This causes build errors if
obj_cgroup_get() is called from code that is agnostic of CONFIG_MEMCG.
The patch resolves this.
Signed-off-by: Kanchana P Sridhar <kanchana.p.sridhar@intel.com>
---
include/linux/memcontrol.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index fe05fdb92779..f693d254ab2a 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -1281,6 +1281,10 @@ struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *css)
return NULL;
}
+static inline void obj_cgroup_get(struct obj_cgroup *objcg)
+{
+}
+
static inline void obj_cgroup_put(struct obj_cgroup *objcg)
{
}
base-commit: 7d0b0d4b77b368b2111fc8b4449e33dfb3c34087
--
2.27.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1] mm: Defines obj_cgroup_get() if CONFIG_MEMCG is not defined.
2024-08-20 19:50 [PATCH v1] mm: Defines obj_cgroup_get() if CONFIG_MEMCG is not defined Kanchana P Sridhar
@ 2024-08-21 15:11 ` Michal Hocko
2024-08-21 19:16 ` Sridhar, Kanchana P
2024-08-21 19:24 ` Nhat Pham
1 sibling, 1 reply; 7+ messages in thread
From: Michal Hocko @ 2024-08-21 15:11 UTC (permalink / raw)
To: Kanchana P Sridhar
Cc: linux-kernel, linux-mm, hannes, yosryahmed, nphamcs,
ryan.roberts, ying.huang, 21cnbao, akpm, nanhai.zou,
wajdi.k.feghali, vinodh.gopal
On Tue 20-08-24 12:50:05, Kanchana P Sridhar wrote:
> This resolves an issue with obj_cgroup_get() not being defined
> if CONFIG_MEMCG is not defined.
Could you paste the compilation error and which tree this is based on?
> This causes build errors if
> obj_cgroup_get() is called from code that is agnostic of CONFIG_MEMCG.
>
> The patch resolves this.
>
> Signed-off-by: Kanchana P Sridhar <kanchana.p.sridhar@intel.com>
> ---
> include/linux/memcontrol.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
> index fe05fdb92779..f693d254ab2a 100644
> --- a/include/linux/memcontrol.h
> +++ b/include/linux/memcontrol.h
> @@ -1281,6 +1281,10 @@ struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *css)
> return NULL;
> }
>
> +static inline void obj_cgroup_get(struct obj_cgroup *objcg)
> +{
> +}
> +
> static inline void obj_cgroup_put(struct obj_cgroup *objcg)
> {
> }
>
> base-commit: 7d0b0d4b77b368b2111fc8b4449e33dfb3c34087
> --
> 2.27.0
>
--
Michal Hocko
SUSE Labs
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH v1] mm: Defines obj_cgroup_get() if CONFIG_MEMCG is not defined.
2024-08-21 15:11 ` Michal Hocko
@ 2024-08-21 19:16 ` Sridhar, Kanchana P
0 siblings, 0 replies; 7+ messages in thread
From: Sridhar, Kanchana P @ 2024-08-21 19:16 UTC (permalink / raw)
To: Michal Hocko
Cc: linux-kernel, linux-mm, hannes, yosryahmed, nphamcs,
ryan.roberts, Huang, Ying, 21cnbao, akpm, Zou, Nanhai, Feghali,
Wajdi K, Gopal, Vinodh, Sridhar, Kanchana P
Hi Michal,
> -----Original Message-----
> From: Michal Hocko <mhocko@suse.com>
> Sent: Wednesday, August 21, 2024 8:11 AM
> To: Sridhar, Kanchana P <kanchana.p.sridhar@intel.com>
> Cc: linux-kernel@vger.kernel.org; linux-mm@kvack.org;
> hannes@cmpxchg.org; yosryahmed@google.com; nphamcs@gmail.com;
> ryan.roberts@arm.com; Huang, Ying <ying.huang@intel.com>;
> 21cnbao@gmail.com; akpm@linux-foundation.org; Zou, Nanhai
> <nanhai.zou@intel.com>; Feghali, Wajdi K <wajdi.k.feghali@intel.com>;
> Gopal, Vinodh <vinodh.gopal@intel.com>
> Subject: Re: [PATCH v1] mm: Defines obj_cgroup_get() if CONFIG_MEMCG is
> not defined.
>
> On Tue 20-08-24 12:50:05, Kanchana P Sridhar wrote:
> > This resolves an issue with obj_cgroup_get() not being defined
> > if CONFIG_MEMCG is not defined.
>
> Could you paste the compilation error and which tree this is based on?
Sure, this link contains the compilation error reported by the kernel test robot:
https://lore.kernel.org/oe-kbuild-all/202408202320.trSaY2o4-lkp@intel.com/
Error:
kernel test robot noticed the following build errors:
[auto build test ERROR on 8c0b4f7b65fd1ca7af01267f491e815a40d77444]
url: https://github.com/intel-lab-lkp/linux/commits/Kanchana-P-Sridhar/mm-zswap-zswap_is_folio_same_filled-takes-an-index-in-the-folio/20240819-101738
base: 8c0b4f7b65fd1ca7af01267f491e815a40d77444
patch link: https://lore.kernel.org/r/20240819021621.29125-3-kanchana.p.sridhar%40intel.com
patch subject: [PATCH v4 2/4] mm: zswap: zswap_store() extended to handle mTHP folios.
config: sparc-randconfig-002-20240820 (https://download.01.org/0day-ci/archive/20240820/202408202320.trSaY2o4-lkp@intel.com/config)
compiler: sparc-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240820/202408202320.trSaY2o4-lkp@intel.com/reproduce)
All errors (new ones prefixed by >>):
mm/zswap.c: In function 'zswap_store_page':
>> mm/zswap.c:1534:17: error: implicit declaration of function 'obj_cgroup_get'; did you mean 'obj_cgroup_put'? [-Wimplicit-function-declaration]
1534 | obj_cgroup_get(objcg);
| ^~~~~~~~~~~~~~
| obj_cgroup_put
My patch fixing the error is based on the mm-unstable branch in this git tree:
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git/
Please let me know if you need any other info.
Thanks,
Kanchana
>
> > This causes build errors if
> > obj_cgroup_get() is called from code that is agnostic of CONFIG_MEMCG.
> >
> > The patch resolves this.
> >
> > Signed-off-by: Kanchana P Sridhar <kanchana.p.sridhar@intel.com>
> > ---
> > include/linux/memcontrol.h | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
> > index fe05fdb92779..f693d254ab2a 100644
> > --- a/include/linux/memcontrol.h
> > +++ b/include/linux/memcontrol.h
> > @@ -1281,6 +1281,10 @@ struct mem_cgroup
> *mem_cgroup_from_css(struct cgroup_subsys_state *css)
> > return NULL;
> > }
> >
> > +static inline void obj_cgroup_get(struct obj_cgroup *objcg)
> > +{
> > +}
> > +
> > static inline void obj_cgroup_put(struct obj_cgroup *objcg)
> > {
> > }
> >
> > base-commit: 7d0b0d4b77b368b2111fc8b4449e33dfb3c34087
> > --
> > 2.27.0
> >
>
> --
> Michal Hocko
> SUSE Labs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1] mm: Defines obj_cgroup_get() if CONFIG_MEMCG is not defined.
2024-08-20 19:50 [PATCH v1] mm: Defines obj_cgroup_get() if CONFIG_MEMCG is not defined Kanchana P Sridhar
2024-08-21 15:11 ` Michal Hocko
@ 2024-08-21 19:24 ` Nhat Pham
2024-08-21 19:40 ` Sridhar, Kanchana P
1 sibling, 1 reply; 7+ messages in thread
From: Nhat Pham @ 2024-08-21 19:24 UTC (permalink / raw)
To: Kanchana P Sridhar
Cc: linux-kernel, linux-mm, hannes, yosryahmed, ryan.roberts,
ying.huang, 21cnbao, akpm, nanhai.zou, wajdi.k.feghali,
vinodh.gopal
On Tue, Aug 20, 2024 at 3:50 PM Kanchana P Sridhar
<kanchana.p.sridhar@intel.com> wrote:
>
> This resolves an issue with obj_cgroup_get() not being defined
> if CONFIG_MEMCG is not defined. This causes build errors if
> obj_cgroup_get() is called from code that is agnostic of CONFIG_MEMCG.
>
> The patch resolves this.
>
> Signed-off-by: Kanchana P Sridhar <kanchana.p.sridhar@intel.com>
> ---
This is only exposed because of your zswap mTHP patch series right?
Could you include this patch as part of that series (since we don't
need this without that patch series), or make it clear in the change
log?
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH v1] mm: Defines obj_cgroup_get() if CONFIG_MEMCG is not defined.
2024-08-21 19:24 ` Nhat Pham
@ 2024-08-21 19:40 ` Sridhar, Kanchana P
2024-08-22 6:14 ` Michal Hocko
0 siblings, 1 reply; 7+ messages in thread
From: Sridhar, Kanchana P @ 2024-08-21 19:40 UTC (permalink / raw)
To: Nhat Pham
Cc: linux-kernel, linux-mm, hannes, yosryahmed, ryan.roberts, Huang,
Ying, 21cnbao, akpm, Zou, Nanhai, Feghali, Wajdi K, Gopal,
Vinodh, Sridhar, Kanchana P
> -----Original Message-----
> From: Nhat Pham <nphamcs@gmail.com>
> Sent: Wednesday, August 21, 2024 12:24 PM
> To: Sridhar, Kanchana P <kanchana.p.sridhar@intel.com>
> Cc: linux-kernel@vger.kernel.org; linux-mm@kvack.org;
> hannes@cmpxchg.org; yosryahmed@google.com; ryan.roberts@arm.com;
> Huang, Ying <ying.huang@intel.com>; 21cnbao@gmail.com; akpm@linux-
> foundation.org; Zou, Nanhai <nanhai.zou@intel.com>; Feghali, Wajdi K
> <wajdi.k.feghali@intel.com>; Gopal, Vinodh <vinodh.gopal@intel.com>
> Subject: Re: [PATCH v1] mm: Defines obj_cgroup_get() if CONFIG_MEMCG is
> not defined.
>
> On Tue, Aug 20, 2024 at 3:50 PM Kanchana P Sridhar
> <kanchana.p.sridhar@intel.com> wrote:
> >
> > This resolves an issue with obj_cgroup_get() not being defined
> > if CONFIG_MEMCG is not defined. This causes build errors if
> > obj_cgroup_get() is called from code that is agnostic of CONFIG_MEMCG.
> >
> > The patch resolves this.
> >
> > Signed-off-by: Kanchana P Sridhar <kanchana.p.sridhar@intel.com>
> > ---
>
> This is only exposed because of your zswap mTHP patch series right?
> Could you include this patch as part of that series (since we don't
> need this without that patch series), or make it clear in the change
> log?
That's correct, Nhat. Although, it might be useful to have obj_cgroup_get()
defined in the case where CONFIG_MEMCG is not defined. memcontrol.h
handles obj_cgroup_put() similarly. Would it be Ok if I included a reference
to the zswap mTHP patch series in the change log?
Thanks,
Kanchana
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1] mm: Defines obj_cgroup_get() if CONFIG_MEMCG is not defined.
2024-08-21 19:40 ` Sridhar, Kanchana P
@ 2024-08-22 6:14 ` Michal Hocko
2024-08-22 16:19 ` Sridhar, Kanchana P
0 siblings, 1 reply; 7+ messages in thread
From: Michal Hocko @ 2024-08-22 6:14 UTC (permalink / raw)
To: Sridhar, Kanchana P
Cc: Nhat Pham, linux-kernel, linux-mm, hannes, yosryahmed,
ryan.roberts, Huang, Ying, 21cnbao, akpm, Zou, Nanhai, Feghali,
Wajdi K, Gopal, Vinodh
On Wed 21-08-24 19:40:42, Sridhar, Kanchana P wrote:
>
> > -----Original Message-----
> > From: Nhat Pham <nphamcs@gmail.com>
> > Sent: Wednesday, August 21, 2024 12:24 PM
> > To: Sridhar, Kanchana P <kanchana.p.sridhar@intel.com>
> > Cc: linux-kernel@vger.kernel.org; linux-mm@kvack.org;
> > hannes@cmpxchg.org; yosryahmed@google.com; ryan.roberts@arm.com;
> > Huang, Ying <ying.huang@intel.com>; 21cnbao@gmail.com; akpm@linux-
> > foundation.org; Zou, Nanhai <nanhai.zou@intel.com>; Feghali, Wajdi K
> > <wajdi.k.feghali@intel.com>; Gopal, Vinodh <vinodh.gopal@intel.com>
> > Subject: Re: [PATCH v1] mm: Defines obj_cgroup_get() if CONFIG_MEMCG is
> > not defined.
> >
> > On Tue, Aug 20, 2024 at 3:50 PM Kanchana P Sridhar
> > <kanchana.p.sridhar@intel.com> wrote:
> > >
> > > This resolves an issue with obj_cgroup_get() not being defined
> > > if CONFIG_MEMCG is not defined. This causes build errors if
> > > obj_cgroup_get() is called from code that is agnostic of CONFIG_MEMCG.
> > >
> > > The patch resolves this.
> > >
> > > Signed-off-by: Kanchana P Sridhar <kanchana.p.sridhar@intel.com>
> > > ---
> >
> > This is only exposed because of your zswap mTHP patch series right?
> > Could you include this patch as part of that series (since we don't
> > need this without that patch series), or make it clear in the change
> > log?
>
> That's correct, Nhat. Although, it might be useful to have obj_cgroup_get()
> defined in the case where CONFIG_MEMCG is not defined. memcontrol.h
> handles obj_cgroup_put() similarly. Would it be Ok if I included a reference
> to the zswap mTHP patch series in the change log?
I would just fold it into the patch which exposes use without
CONFIG_MEMCG. We currently do not have any such user. That's why I've
asked what is this patch based on.
--
Michal Hocko
SUSE Labs
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH v1] mm: Defines obj_cgroup_get() if CONFIG_MEMCG is not defined.
2024-08-22 6:14 ` Michal Hocko
@ 2024-08-22 16:19 ` Sridhar, Kanchana P
0 siblings, 0 replies; 7+ messages in thread
From: Sridhar, Kanchana P @ 2024-08-22 16:19 UTC (permalink / raw)
To: Michal Hocko
Cc: Nhat Pham, linux-kernel, linux-mm, hannes, yosryahmed,
ryan.roberts, Huang, Ying, 21cnbao, akpm, Zou, Nanhai, Feghali,
Wajdi K, Gopal, Vinodh, Sridhar, Kanchana P
> -----Original Message-----
> From: Michal Hocko <mhocko@suse.com>
> Sent: Wednesday, August 21, 2024 11:15 PM
> To: Sridhar, Kanchana P <kanchana.p.sridhar@intel.com>
> Cc: Nhat Pham <nphamcs@gmail.com>; linux-kernel@vger.kernel.org; linux-
> mm@kvack.org; hannes@cmpxchg.org; yosryahmed@google.com;
> ryan.roberts@arm.com; Huang, Ying <ying.huang@intel.com>;
> 21cnbao@gmail.com; akpm@linux-foundation.org; Zou, Nanhai
> <nanhai.zou@intel.com>; Feghali, Wajdi K <wajdi.k.feghali@intel.com>;
> Gopal, Vinodh <vinodh.gopal@intel.com>
> Subject: Re: [PATCH v1] mm: Defines obj_cgroup_get() if CONFIG_MEMCG is
> not defined.
>
> On Wed 21-08-24 19:40:42, Sridhar, Kanchana P wrote:
> >
> > > -----Original Message-----
> > > From: Nhat Pham <nphamcs@gmail.com>
> > > Sent: Wednesday, August 21, 2024 12:24 PM
> > > To: Sridhar, Kanchana P <kanchana.p.sridhar@intel.com>
> > > Cc: linux-kernel@vger.kernel.org; linux-mm@kvack.org;
> > > hannes@cmpxchg.org; yosryahmed@google.com;
> ryan.roberts@arm.com;
> > > Huang, Ying <ying.huang@intel.com>; 21cnbao@gmail.com; akpm@linux-
> > > foundation.org; Zou, Nanhai <nanhai.zou@intel.com>; Feghali, Wajdi K
> > > <wajdi.k.feghali@intel.com>; Gopal, Vinodh <vinodh.gopal@intel.com>
> > > Subject: Re: [PATCH v1] mm: Defines obj_cgroup_get() if CONFIG_MEMCG
> is
> > > not defined.
> > >
> > > On Tue, Aug 20, 2024 at 3:50 PM Kanchana P Sridhar
> > > <kanchana.p.sridhar@intel.com> wrote:
> > > >
> > > > This resolves an issue with obj_cgroup_get() not being defined
> > > > if CONFIG_MEMCG is not defined. This causes build errors if
> > > > obj_cgroup_get() is called from code that is agnostic of
> CONFIG_MEMCG.
> > > >
> > > > The patch resolves this.
> > > >
> > > > Signed-off-by: Kanchana P Sridhar <kanchana.p.sridhar@intel.com>
> > > > ---
> > >
> > > This is only exposed because of your zswap mTHP patch series right?
> > > Could you include this patch as part of that series (since we don't
> > > need this without that patch series), or make it clear in the change
> > > log?
> >
> > That's correct, Nhat. Although, it might be useful to have obj_cgroup_get()
> > defined in the case where CONFIG_MEMCG is not defined. memcontrol.h
> > handles obj_cgroup_put() similarly. Would it be Ok if I included a reference
> > to the zswap mTHP patch series in the change log?
>
> I would just fold it into the patch which exposes use without
> CONFIG_MEMCG. We currently do not have any such user. That's why I've
> asked what is this patch based on.
Ok, this sounds good, Michal and Nhat.
Thanks,
Kanchana
> --
> Michal Hocko
> SUSE Labs
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-08-22 16:19 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-20 19:50 [PATCH v1] mm: Defines obj_cgroup_get() if CONFIG_MEMCG is not defined Kanchana P Sridhar
2024-08-21 15:11 ` Michal Hocko
2024-08-21 19:16 ` Sridhar, Kanchana P
2024-08-21 19:24 ` Nhat Pham
2024-08-21 19:40 ` Sridhar, Kanchana P
2024-08-22 6:14 ` Michal Hocko
2024-08-22 16:19 ` Sridhar, Kanchana P
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox