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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAD07EB8FB5 for ; Wed, 6 Sep 2023 07:07:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230295AbjIFHHx (ORCPT ); Wed, 6 Sep 2023 03:07:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229948AbjIFHHw (ORCPT ); Wed, 6 Sep 2023 03:07:52 -0400 Received: from out30-113.freemail.mail.aliyun.com (out30-113.freemail.mail.aliyun.com [115.124.30.113]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8107FE50; Wed, 6 Sep 2023 00:07:47 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R211e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---0VrSmrBZ_1693984063; Received: from 30.240.113.202(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0VrSmrBZ_1693984063) by smtp.aliyun-inc.com; Wed, 06 Sep 2023 15:07:44 +0800 Message-ID: <62cf5489-802a-ce37-16ea-bb9d8c92399d@linux.alibaba.com> Date: Wed, 6 Sep 2023 15:07:41 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH v4 1/2] perf/core: Bail out early if the request AUX area is out of bound Content-Language: en-US To: Leo Yan Cc: James Clark , Peter Zijlstra , alexander.shishkin@linux.intel.com, mingo@redhat.com, baolin.wang@linux.alibaba.com, acme@kernel.org, mark.rutland@arm.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com, adrian.hunter@intel.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, nathan@kernel.org, bpf@vger.kernel.org References: <20230804072945.85731-1-xueshuai@linux.alibaba.com> <20230804072945.85731-2-xueshuai@linux.alibaba.com> <20230804085947.GB589820@leoy-yangtze.lan> <534c5e53-07bb-07bd-0435-76a10b55228d@linux.alibaba.com> <20230906070238.GC388456@leoy-huanghe.lan> From: Shuai Xue In-Reply-To: <20230906070238.GC388456@leoy-huanghe.lan> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/9/6 15:02, Leo Yan wrote: > Hi Shuai, > > On Wed, Sep 06, 2023 at 11:27:38AM +0800, Shuai Xue wrote: > > [...] > >>>>> + /* Can't allocate more than MAX_ORDER */ >>>> >>>> The comment is confused. I'd like to refine it as: >>>> >>>> /* >>>> * kcalloc_node() is unable to allocate buffer if the size is larger >>>> * than: PAGE_SIZE << MAX_ORDER; directly bail out in this case. >>>> */ >>> >>> Hi, Leo, >>> >>> Thank you for your quick feedback. The comment is simplified from Peter's reply in v2 >>> version. Your refined comment is more detailed and it makes sense to me, I would like >>> to adopt it if @Peter has no other opinions. >>> >>>> To be honest, I am not sure if perf core maintainers like this kind >>>> thing or not. Please seek their opinion before you move forward. >>>> >>> >>> and hi, all perf core maintainers, >>> >>> I have not received explicit objection from perf core maintainers @Peter or @James so >>> I moved forward to address their comments. It's fine to me to wait for more opinions from >>> perf core maintainers. >>> >>> Best Regards, >>> Shuai >>> >> >> Hi, Leo, and all folks, >> >> Any more comments? Should I move forward to send a new patch? > > I am afraid I cannot give a reliable suggestion. > > Anyway, I personally think the returned error value in this patch is > better than the kernel oops since the kernel oops is a bit scary for > tool's users ;) Another reason is the perf core layer should report > error earlier rather than relying on the page buddy allocation layer > to detect the memory allocation failure, which is easier for both > developers and users to understand the failure. > > IMHO, a good practice is to respin a new patch set and send out for > review. Good luck! > Hi, Leo, Thanks for valuable comments. I will send a new patch set. Thank you. Best Regards, Shuai