From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98740C433F5 for ; Mon, 7 Feb 2022 19:34:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 207DD6B0074; Mon, 7 Feb 2022 14:34:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1B7466B0075; Mon, 7 Feb 2022 14:34:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 058786B0078; Mon, 7 Feb 2022 14:34:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0095.hostedemail.com [216.40.44.95]) by kanga.kvack.org (Postfix) with ESMTP id EA84F6B0074 for ; Mon, 7 Feb 2022 14:34:12 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 9B4D2180AB9F7 for ; Mon, 7 Feb 2022 19:34:12 +0000 (UTC) X-FDA: 79116984744.06.76E702B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf08.hostedemail.com (Postfix) with ESMTP id 200D0160004 for ; Mon, 7 Feb 2022 19:34:11 +0000 (UTC) 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= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-623-aVSMeVKxOSmcoeJFlsExTA-1; Mon, 07 Feb 2022 14:34:08 -0500 X-MC-Unique: aVSMeVKxOSmcoeJFlsExTA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4E2761898291; Mon, 7 Feb 2022 19:34:05 +0000 (UTC) Received: from [10.22.32.15] (unknown [10.22.32.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id BDA3A452E6; Mon, 7 Feb 2022 19:33:57 +0000 (UTC) Message-ID: <53f89ef2-3894-ad23-7484-38ce192bce20@redhat.com> Date: Mon, 7 Feb 2022 14:33:57 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH v4 3/4] mm/page_owner: Print memcg information Content-Language: en-US To: Andrew Morton , Michal Hocko Cc: Johannes Weiner , Vladimir Davydov , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Andy Shevchenko , Rasmus Villemoes , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, Ira Weiny , Mike Rapoport , David Rientjes , Roman Gushchin , Rafael Aquini 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> From: Waiman Long In-Reply-To: <20220207110947.f07b58898d91c02090f9aacf@linux-foundation.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Stat-Signature: e9jnco9nnm94xkc4b7gj8ec5pc7j9xq7 X-Rspam-User: nil Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=gZBkxxMJ; spf=none (imf08.hostedemail.com: domain of longman@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=longman@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 200D0160004 X-HE-Tag: 1644262451-512763 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 >