linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: kernel test robot <lkp@intel.com>,
	Domenico Cerasuolo <cerasuolodomenico@gmail.com>,
	oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>,
	Nhat Pham <nphamcs@gmail.com>
Subject: Re: [akpm-mm:mm-unstable 179/192] mm/zswap.c:825:17: error: dereferencing pointer to incomplete type 'struct mem_cgroup'
Date: Wed, 29 Nov 2023 13:53:42 -0800	[thread overview]
Message-ID: <20231129135342.5697165df1adfff04c749082@linux-foundation.org> (raw)
In-Reply-To: <20231129134313.656e76c2e3fec1361007633b@linux-foundation.org>

On Wed, 29 Nov 2023 13:43:13 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:

> On Wed, 29 Nov 2023 23:42:11 +0800 kernel test robot <lkp@intel.com> wrote:
> 
> > >> mm/zswap.c:825:17: error: dereferencing pointer to incomplete type 'struct mem_cgroup'
> >       css_get(&memcg->css);
> >                     ^~
> 
> OK, thanks, patchset needs work for CONFIG_MEMCG=n.  I'll drop this version.

Well that's annoying - the "mm: memcg: subtree stats flushing and
thresholds" series had lots of dependencies on this series.

So I'll restore this series with this hack:


 include/linux/memcontrol.h |    5 +++++
 mm/zswap.c                 |    3 +++
 2 files changed, 8 insertions(+)

--- a/include/linux/memcontrol.h~zswap-make-shrinking-memcg-aware-fix
+++ a/include/linux/memcontrol.h
@@ -1165,6 +1165,11 @@ unsigned long mem_cgroup_soft_limit_recl
 
 #define MEM_CGROUP_ID_SHIFT	0
 
+static inline struct mem_cgroup *obj_cgroup_memcg(struct obj_cgroup *objcg)
+{
+	return NULL;
+}
+
 static inline struct mem_cgroup *folio_memcg(struct folio *folio)
 {
 	return NULL;
--- a/mm/zswap.c~zswap-make-shrinking-memcg-aware-fix
+++ a/mm/zswap.c
@@ -32,6 +32,7 @@
 #include <linux/mm_types.h>
 #include <linux/page-flags.h>
 #include <linux/swapops.h>
+#include <linux/memcontrol.h>
 #include <linux/writeback.h>
 #include <linux/pagemap.h>
 #include <linux/workqueue.h>
@@ -822,7 +823,9 @@ static void shrink_worker(struct work_st
 		 * Acquire an extra reference to the iterated memcg in case the
 		 * original reference is dropped by the zswap offlining callback.
 		 */
+#ifdef CONFIG_MEMCG
 		css_get(&memcg->css);
+#endif
 		spin_unlock(&zswap_pools_lock);
 
 		ret = shrink_memcg(memcg);
_



  reply	other threads:[~2023-11-29 21:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-29 15:42 kernel test robot
2023-11-29 21:43 ` Andrew Morton
2023-11-29 21:53   ` Andrew Morton [this message]
2023-11-29 22:18     ` Yosry Ahmed
2023-11-29 22:29       ` Andrew Morton
2023-11-29 22:31         ` Yosry Ahmed
2023-11-29 22:53           ` Andrew Morton
2023-11-30  0:02           ` Nhat Pham
2023-11-30  0:13             ` Yosry Ahmed
2023-11-30  0:18               ` Nhat Pham
2023-11-30 19:46                 ` Nhat Pham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231129135342.5697165df1adfff04c749082@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=cerasuolodomenico@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=nphamcs@gmail.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox