Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp2392035rdb; Wed, 6 Sep 2023 03:28:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGxItSJAki7Ajq5O0BbRvc7DtQ931TiCd7Gu+0n6mGPLnq+fiB7oKkSOuwHnOKaGcjSgK8v X-Received: by 2002:a17:907:7842:b0:9a1:e233:e627 with SMTP id lb2-20020a170907784200b009a1e233e627mr1820577ejc.42.1693996130249; Wed, 06 Sep 2023 03:28:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693996130; cv=none; d=google.com; s=arc-20160816; b=eobg6JGe2VV4Ic1QVzSX83sg6OgLnsyQuNcGxADGX++Jw+tzOB04xS5BqjUAC1FJ5B Fd7fysQ+rvPZotUcIJ0/HQdyPpurTvvnovsv49/jGAf2El8F7x6GD9OXAMNNAjIJ1ilu 2IS/IkA1dqZVvpHq3cpmtpT1cUqMAJAShC20Ov4o1gNODT6/XRpCy2qos3YctjkTNbvK zkUkcMQFgtt0pIbAlOcTcOaLKdpwbq9CsiCd0+gM0Lq4AqM7Ra0xrU4OCfI697RNL7P4 oVyiRgKHYlrgBkKprFEyY+dVuoD0PU7AnVxEt7vOR4yaUBhRvzEv7PQ8GLHC/tKUA0kn HhGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=g3LG/jZERAUkV2uQGC9CJZuLysMkDi2eDccqVg8AWRw=; fh=LY+gUPa8ZOo2z5piZ+W2mYfEvl4PTOnoGU+ktewptJc=; b=JJGW5XQE5i57jwe9gwjCb/vdtbLdtSO2aV4b77dfVb3KK8QwU+avKYhu1ye0sWFMgk y98oHv8i6ndGZtTXP7pX01n+BjaeUnSwQadGL9XZqaF4hurvKoSfFyG6W8f9AY5fLbg3 V6jyJ0O5BbQPGmX/5Ol00xHLDioTu+06TQpkGgOWMhg4tWejcKkIanlGBTxEvWmcLm7e hiiVG73BZD4eM828EhRQufMN2QG8KO3MSQPM1Dz9APO8GOOCrRyDRjQoSp6rLvOWFzZf iqruxIbhx9uRGWoyfZXyrZPs1LTN/ft7IgYadQdlV/01nHy4aTL2l9F4JU/mmNgck1op d8tw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a22-20020a170906469600b00997d002ae21si9136400ejr.90.2023.09.06.03.28.22; Wed, 06 Sep 2023 03:28:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230239AbjIFHHx (ORCPT + 99 others); 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 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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