From: SeongJae Park <sj@kernel.org>
To: Xiu Jianfeng <xiujianfeng@huawei.com>
Cc: SeongJae Park <sj@kernel.org>,
akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 -next] mm/hugetlb_cgroup: register lockdep key for cftype
Date: Tue, 18 Jun 2024 16:36:08 -0700 [thread overview]
Message-ID: <20240618233608.400367-1-sj@kernel.org> (raw)
In-Reply-To: <20240618071922.2127289-1-xiujianfeng@huawei.com>
Hi Xiu,
On Tue, 18 Jun 2024 07:19:22 +0000 Xiu Jianfeng <xiujianfeng@huawei.com> wrote:
> When CONFIG_DEBUG_LOCK_ALLOC is enabled, the following commands can
> trigger a bug,
>
> mount -t cgroup2 none /sys/fs/cgroup
> cd /sys/fs/cgroup
> echo "+hugetlb" > cgroup.subtree_control
[...]
> diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c
> index 2b899c4ae968..4ff238ba1250 100644
> --- a/mm/hugetlb_cgroup.c
> +++ b/mm/hugetlb_cgroup.c
> @@ -836,6 +836,8 @@ hugetlb_cgroup_cfttypes_init(struct hstate *h, struct cftype *cft,
> cft->file_offset = MEMFILE_OFFSET0(offset) +
> MEMFILE_FIELD_SIZE(offset) * idx;
> }
> +
> + lockdep_register_key(&cft->lockdep_key);
> }
> }
I found the latest mm-unstable tree fails build as below, and 'git bisect'
points this patch.
linux/mm/hugetlb_cgroup.c: In function ‘hugetlb_cgroup_cfttypes_init’:
linux/mm/hugetlb_cgroup.c:840:42: error: ‘struct cftype’ has no member named ‘lockdep_key’
840 | lockdep_register_key(&cft->lockdep_key);
| ^~
Maybe we should take care of CONFIG_DEBUG_LOCK_ALLOC undefined case, like
below?
diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c
index a45065698419..9747c2e64e95 100644
--- a/mm/hugetlb_cgroup.c
+++ b/mm/hugetlb_cgroup.c
@@ -837,7 +837,9 @@ hugetlb_cgroup_cfttypes_init(struct hstate *h, struct cftype *cft,
MEMFILE_FIELD_SIZE(offset) * idx;
}
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
lockdep_register_key(&cft->lockdep_key);
+#endif
}
}
[...]
Thanks,
SJ
next prev parent reply other threads:[~2024-06-18 23:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-18 7:19 Xiu Jianfeng
[not found] ` <CGME20240618201744eucas1p1d5ea63c6b776e2e1770a6d0ba9c86ae4@eucas1p1.samsung.com>
2024-06-18 20:17 ` Marek Szyprowski
2024-06-18 23:36 ` SeongJae Park [this message]
2024-06-19 2:16 ` xiujianfeng
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=20240618233608.400367-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=xiujianfeng@huawei.com \
/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