From mboxrd@z Thu Jan 1 00:00:00 1970 From: Waiman Long Subject: Re: [PATCH v4 3/4] mm/page_owner: Print memcg information Date: Mon, 7 Feb 2022 14:33:57 -0500 Message-ID: <53f89ef2-3894-ad23-7484-38ce192bce20@redhat.com> References: <20220131192308.608837-5-longman@redhat.com> <20220202203036.744010-4-longman@redhat.com> <3f042edb-3769-afea-17a7-899578cd5c69@redhat.com> <20220207110947.f07b58898d91c02090f9aacf@linux-foundation.org> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644262451; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Mt0dY24O8oy81HO9eljR8ZyBXQGPacTP1E1VhcVXUbE=; b=gZBkxxMJizo3mPCjQT6YvqGdeTOzA7uAmfYRANSXAsOMj0gATDhucQSGsHRYkuxUqLaP1w YHoPGae+RVQnq5mhxM3QWWCh/fFuzoQLpjDetw59EmWq6mNms+9UJT9rxi6qUfgUo0CjIr GKR11xdo1r8HBzpYWVtQFA+dl9hC50w= Content-Language: en-US In-Reply-To: <20220207110947.f07b58898d91c02090f9aacf-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org> List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Andrew Morton , Michal Hocko Cc: Johannes Weiner , Vladimir Davydov , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Andy Shevchenko , Rasmus Villemoes , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, Ira Weiny , Mike Rapoport , David Rientjes , Roman Gushchin , Rafael Aquini On 2/7/22 14:09, Andrew Morton wrote: > On Mon, 7 Feb 2022 18:20:04 +0100 Michal Hocko wrote: > >> On Thu 03-02-22 14:03:58, Waiman Long wrote: >>> On 2/3/22 07:46, Michal Hocko wrote: >>>> On Wed 02-02-22 15:30:35, Waiman Long wrote: >>>> [...] >> ... >>>>> + 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 >