Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp769763pxy; Fri, 30 Apr 2021 16:27:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCAi3fAZLYNL//3Wx2ryo9UaJqKbqVo4umyrKXvm65NR9zHDLV03sqzdEb4KXCjcEuB0KH X-Received: by 2002:a17:906:1e49:: with SMTP id i9mr6823367ejj.536.1619825243466; Fri, 30 Apr 2021 16:27:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619825243; cv=none; d=google.com; s=arc-20160816; b=YvGDO9eqJnfqGRGJOxzO1il36iLrzXm2kFWX2wiJRmUtru+2VWdI/I/fG6o0AcOEpT vI/dUR5RCmep1EqUVan7rN4Xo7OOmEc32p73GiprDou5ZEX7likI3HuSnSgiM+o5PhNs 58foo4iQYh10RuUXCzZ5QDWVZBrnDzQOlZp8a0JLf2NYXjVC0C0K+8+90aOk2qMj4LBs RKx6TMn4oi7B7tHFbumV6zbae/AQciwc7+E/YJxcwQOiPlPfVzaNSWydk0Brr/42r0/m GlESwr5gSuwsVWK8mHAYZz/+IpgzdKcWQrUce3r7fvOF9ItWSYrs1mm0574mdRARvpI9 2qGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:mime-version:user-agent:message-id :in-reply-to:date:references:cc:to:from; bh=e6IWfda0frC/sPHJmgOuTzPJ9sdpOieugVZmqvfxZ9Y=; b=xNQuMRxSSnz3o3aqP7aSp/BKfCuNQIyFFvXyJ6pPXhTVoUhWyQmdn8BqQd7TMTHLjW NKu9QCE6dxrl2azba6jth8Yt80cjeSZniH/RX+OUVCqc0MFRXOpThvJHsnDQbcxFmT3A n3xBI0BbiUGNOkwwtpweyMxPHwzQ4TL/4M9D9MFR3BKbA0HBwSVwz3MvcdNq92skVvkS TbpjI8z35vqqD9PwoUK2xzrY0FQQqu+tlNGvDRhF0hB1pUxj+PGEsmgOSEdkAVs15Pzz /LvNnDK5X2vIatpFzopQP+77LVhez5IAUOtUNsYhfNkg7wpiZv0HloaMSAxy3Fv4FDLn zG4w== 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=xmission.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a3si4621770ejj.228.2021.04.30.16.26.59; Fri, 30 Apr 2021 16:27:23 -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=xmission.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232817AbhD3XYp (ORCPT + 99 others); Fri, 30 Apr 2021 19:24:45 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:37844 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230508AbhD3XYp (ORCPT ); Fri, 30 Apr 2021 19:24:45 -0400 Received: from in02.mta.xmission.com ([166.70.13.52]) by out01.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lccUF-00CsoG-Qp; Fri, 30 Apr 2021 17:23:55 -0600 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95] helo=fess.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lccUE-007HaN-Pp; Fri, 30 Apr 2021 17:23:55 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Marco Elver Cc: Arnd Bergmann , Florian Weimer , "David S. Miller" , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Peter Collingbourne , Dmitry Vyukov , Alexander Potapenko , sparclinux , linux-arch , Linux Kernel Mailing List , Linux API , kasan-dev References: Date: Fri, 30 Apr 2021 18:23:51 -0500 In-Reply-To: (Eric W. Biederman's message of "Fri, 30 Apr 2021 17:49:45 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1lccUE-007HaN-Pp;;;mid=;;;hst=in02.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1/xW7yT9MZRBfGY7mc5Y3fx4buEUPwx95M= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on sa03.xmission.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=8.0 tests=ALL_TRUSTED,BAYES_20, DCC_CHECK_NEGATIVE autolearn=disabled version=3.4.2 X-Spam-Virus: No X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * -0.0 BAYES_20 BODY: Bayes spam probability is 5 to 20% * [score: 0.0621] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa03 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa03 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Marco Elver X-Spam-Relay-Country: X-Spam-Timing: total 286 ms - load_scoreonly_sql: 0.03 (0.0%), signal_user_changed: 4.5 (1.6%), b_tie_ro: 3.0 (1.1%), parse: 1.04 (0.4%), extract_message_metadata: 2.8 (1.0%), get_uri_detail_list: 0.72 (0.3%), tests_pri_-1000: 3.9 (1.4%), tests_pri_-950: 1.24 (0.4%), tests_pri_-900: 1.01 (0.4%), tests_pri_-90: 83 (28.9%), check_bayes: 81 (28.3%), b_tokenize: 4.2 (1.5%), b_tok_get_all: 5 (1.8%), b_comp_prob: 1.29 (0.5%), b_tok_touch_all: 67 (23.6%), b_finish: 0.71 (0.2%), tests_pri_0: 173 (60.5%), check_dkim_signature: 0.36 (0.1%), check_dkim_adsp: 2.6 (0.9%), poll_dns_idle: 1.24 (0.4%), tests_pri_10: 2.2 (0.8%), tests_pri_500: 7 (2.3%), rewrite_mail: 0.00 (0.0%) Subject: Is perf_sigtrap synchronous? X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I am looking at perf_sigtrap and I am confused by the code. /* * We'd expect this to only occur if the irq_work is delayed and either * ctx->task or current has changed in the meantime. This can be the * case on architectures that do not implement arch_irq_work_raise(). */ if (WARN_ON_ONCE(event->ctx->task != current)) return; /* * perf_pending_event() can race with the task exiting. */ if (current->flags & PF_EXITING) return; It performs tests that absolutely can never fail if we are talking about a synchronous exception. The code force_sig family of functions only make sense to use with and are only safe to use with synchronous exceptions. Are the tests in perf_sigtrap necessary or is perf_sigtrap not reporting a synchronous event? Eric