Thread (39 messages) read the whole thread 39 messages, 8 authors, 2022-02-08

Re: [PATCH v4 3/4] mm/page_owner: Print memcg information

From: Waiman Long <hidden>
Date: 2022-02-07 19:38:41
Also in: linux-mm, lkml

On 2/7/22 14:09, Andrew Morton wrote:
On Mon, 7 Feb 2022 18:20:04 +0100 Michal Hocko [off-list ref] wrote:
quoted
On Thu 03-02-22 14:03:58, Waiman Long wrote:
quoted
On 2/3/22 07:46, Michal Hocko wrote:
quoted
On Wed 02-02-22 15:30:35, Waiman Long wrote:
[...]
...
quoted
quoted
quoted
+	online = (memcg->css.flags & CSS_ONLINE);
+	cgroup_name(memcg->css.cgroup, name, sizeof(name));
Is there any specific reason to use another buffer allocated on the
stack? Also 80B seems too short to cover NAME_MAX.

Nothing else jumped at me.
I suppose we can print directly into kbuf with cgroup_name(), but using a
separate buffer is easier to read and understand. 79 characters should be
enough for most cgroup names. Some auto-generated names with some kind of
embedded uuids may be longer than that, but the random sequence of hex
digits that may be missing do not convey much information for identification
purpose. We can always increase the buffer length later if it turns out to
be an issue.
Cutting a name short sounds like a source of confusion and there doesn't
seem to be any good reason for that.
Yes.  If we give them 79 characters, someone will go and want 94.  If
we can prevent this once and for ever, let's please do so.
Sure. Will send a version with that change.

Cheers,
Longman
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help