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 X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CED14C3F2D1 for ; Fri, 28 Feb 2020 10:40:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AA722246A8 for ; Fri, 28 Feb 2020 10:40:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726744AbgB1Kki (ORCPT ); Fri, 28 Feb 2020 05:40:38 -0500 Received: from foss.arm.com ([217.140.110.172]:36324 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726063AbgB1Kki (ORCPT ); Fri, 28 Feb 2020 05:40:38 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C65774B2; Fri, 28 Feb 2020 02:40:37 -0800 (PST) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E09FB3F73B; Fri, 28 Feb 2020 02:40:36 -0800 (PST) Date: Fri, 28 Feb 2020 10:40:34 +0000 From: Sudeep Holla To: Zeng Tao Cc: linuxarm@huawei.com, Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Sudeep Holla Subject: Re: [PATCH] cpu-topology: Fix the potential data corruption Message-ID: <20200228104034.GB26973@bogus> References: <1582878945-50415-1-git-send-email-prime.zeng@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1582878945-50415-1-git-send-email-prime.zeng@hisilicon.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 28, 2020 at 04:35:45PM +0800, Zeng Tao wrote: > Currently there are only 10 bytes to store the cpu-topology info. > That is: > snprintf(buffer, 10, "cluster%d",i); > snprintf(buffer, 10, "thread%d",i); > snprintf(buffer, 10, "core%d",i); > > In the boundary test, if the cluster number exceeds 100, there will be a I don't understand you mention of 100 in particular above. I can see issue if there are cluster with more than 2-digit id. Though highly unlikely for now, but I don't have objection to the patch. -- Regards, Sudeep