Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp241938pxb; Wed, 15 Sep 2021 00:35:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysRfhW50sLiAnpLwcqb+m63fpM6jk5G8qeVm/uIYiIt+ouAooatRUHuB8y4EE+XjCF3QX/ X-Received: by 2002:a6b:905:: with SMTP id t5mr17285336ioi.209.1631691347027; Wed, 15 Sep 2021 00:35:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631691347; cv=none; d=google.com; s=arc-20160816; b=Ur2Lo9OV6pa1PZIYh/lu7cmihScuPcrBj6DC5bAbALdB5aS4Evg7DwIFMV6kVlbLWK gp/aMBuXbEZjtrJEssJwujYcvdERyWSGhl8CXQ+8TuQERqc+1dZD5rU2C/ynLGe5bssf WyI9+79n4xiMkVvWp3GzugrM3kM0j1gsue/ubDIDdQDavE67NB+4LqEE2FgScqccU33t hhJNq4sILgBWxb8NuEuKmI/Uyeqz9b5vl7uqzfn2lDwMFmw3Ykz8evlJb2RSD0yUyhb0 Dv48/EMcMVgbL06saMAv0lFM8eFSJaqI67VFZciwHIzEl/k+3tCAdV8ZYKr573O5YGm3 qPqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:to :from:subject; bh=jTl0hpLLCq6+9XaFDTFCKdaJSaJs3Ye2q26KlekXbrc=; b=WglbKw8BunkpUn/NhNkmFogWmcl+gd1K575geAu2VOzpl/fH31Ykjdufk3JfOpc2y2 rtLBjbDKQeeV8Q6eU6b4AVNtPU7NEkcqcn4UOOM3y8moycFLKGdyYDk4ZD3XZZ9m4DjN My7QfX2+x6BmChh2nCnJhjc3ezBYFvh1TOva8W4Dcjyvq1p7w0n909sanadeV+wUIdOp 0IVAr+W9Ji3K7V2J3bV3OEtbkimYEu7mtEwHtMuJKMj7Cu/xdfX8LPTkovX+pvQJNxPn 8uIyAhsqz5fiYk7plu8s58NAXTFqGap6BMDVG8Ep51B/QbGJmVNcFVdv1b8bKLomdwl6 uCbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q22si11795263jae.93.2021.09.15.00.35.12; Wed, 15 Sep 2021 00:35:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231425AbhIOHfo (ORCPT + 99 others); Wed, 15 Sep 2021 03:35:44 -0400 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:54171 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231228AbhIOHfn (ORCPT ); Wed, 15 Sep 2021 03:35:43 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=yun.wang@linux.alibaba.com;NM=1;PH=DS;RN=20;SR=0;TI=SMTPD_---0UoSuf-e_1631691260; Received: from testdeMacBook-Pro.local(mailfrom:yun.wang@linux.alibaba.com fp:SMTPD_---0UoSuf-e_1631691260) by smtp.aliyun-inc.com(127.0.0.1); Wed, 15 Sep 2021 15:34:21 +0800 Subject: Re: [PATCH] perf: fix panic by disable ftrace on fault.c From: =?UTF-8?B?546L6LSH?= To: Dave Hansen , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , "open list:X86 MM" , "open list:BPF (Safe dynamic programs and tools)" , "open list:BPF (Safe dynamic programs and tools)" References: <09777a57-a771-5e17-7e17-afc03ea9b83b@linux.alibaba.com> <4f63c8bc-1d09-1717-cf81-f9091a9f9fb0@linux.alibaba.com> <18252e42-9c30-73d4-e3bb-0e705a78af41@intel.com> <4cba7088-f7c8-edcf-02cd-396eb2a56b46@linux.alibaba.com> Message-ID: <09d0190b-f2cc-9e64-4d3a-4eb0def22b7b@linux.alibaba.com> Date: Wed, 15 Sep 2021 15:34:20 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/9/15 下午3:22, 王贇 wrote: > > > On 2021/9/15 上午11:27, Dave Hansen wrote: >> On 9/14/21 6:56 PM, 王贇 wrote: >>>>> [ 44.134987][ C0] ? __sanitizer_cov_trace_pc+0x7/0x60 >>>>> [ 44.135005][ C0] ? kcov_common_handle+0x30/0x30 >>>> Just turning off tracing for the page fault handler is papering over the >>>> problem. It'll just come back later with a slightly different form. >>>> >>> Cool~ please let me know when you have the proper approach. >> >> It's an entertaining issue, but I wasn't planning on fixing it myself. >> > > Do you have any suggestion on how should we fix the problem? > > I'd like to help fix it, but sounds like all the known working approach > are not acceptable... Hi, Dave, Peter What if we just increase the stack size when ftrace enabled? Maybe like: diff --git a/arch/x86/include/asm/page_64_types.h b/arch/x86/include/asm/page_64_types.h index a8d4ad85..bc2e0c1 100644 --- a/arch/x86/include/asm/page_64_types.h +++ b/arch/x86/include/asm/page_64_types.h @@ -12,10 +12,16 @@ #define KASAN_STACK_ORDER 0 #endif +#ifdef CONFIG_FUNCTION_TRACER +#define FTRACE_STACK_ORDER 1 +#else +#define FTRACE_STACK_ORDER 0 +#endif + #define THREAD_SIZE_ORDER (2 + KASAN_STACK_ORDER) #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) -#define EXCEPTION_STACK_ORDER (0 + KASAN_STACK_ORDER) +#define EXCEPTION_STACK_ORDER (0 + KASAN_STACK_ORDER + FTRACE_STACK_ORDER) #define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER) #define IRQ_STACK_ORDER (2 + KASAN_STACK_ORDER) Just like kasan we give more stack space for ftrace, is this looks acceptable to you? Regards, Michael Wang > > Regards, > Michael Wang >