Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1424490rwb; Thu, 8 Dec 2022 10:25:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf5ZqFjLSCwZaZ8D8hSVHcP7HtDD7/R7LqGjbF2Bq9cjZLMRfskmNkZ9pVpvaMm7dFbozBpp X-Received: by 2002:aa7:c988:0:b0:46b:aedf:f330 with SMTP id c8-20020aa7c988000000b0046baedff330mr31307590edt.76.1670523942227; Thu, 08 Dec 2022 10:25:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1670523942; cv=pass; d=google.com; s=arc-20160816; b=fVnuF3Da57up/jXDOMKNKpOHR/5WtTEc9rVKMS8gN/q7i2gWadJVh5CQ+GkVpfVGd1 Zycscf8iCDZVB9qNKw5a8SRFb+kDmIYRPPkTicC74GbEHryK/w8XqtbWkgj0Dt1v0h0P 9R3S4BeG3dm4N6sm5TchSkgwiIkpoozeRds092PNSupAn+GuupaFo37+wcqyf2n8ARwj le14b4ul9b0zopMwBCzZpjCFYQ+mLOrdPVtLYU37vfp5vJ1IMl3ht17n2i38p7M5a75D eVHiM9vYgYqugtSpoIekcxTcul5YqZNj3X5ImEREZeSCCLEe5pk1vNvQgdGMylx1FqoK Zicg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=IKx0XOvt+Bq/1+YMwu6oCV2ooLxA/GlNshkW/f/mEW0=; b=D/VqobUDYSFoWOdLYWphm3pScuqKt/vIJwKnhDQebiN1ZI0nS3Ywfw1ohVZe/fqaJb /QtaXpVvTd8slE68MzC56tmRZoTs8mqKmKywSq3m3njmgKeo91mjSPC+bYZvHCLdozgd OGhIXqq9P2lZTq7LfIU/oezKGqkETBqKcMlNbEuU3aOXl702HFdYUwJUbGjUGZ81rnet dNHmiwxvGVhvS8ZXoBBU2WDWFo9VJCVHWg1oZUJmWo+dkugE2BqZUh1mMXDNyOvMWxZl NFxrXFGX85LUZEzHgJJXNeQ6A6ATnlV5wIGYwlqVSaPFZZNTIMUppa1360y+opCQ1Npm S9Yg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@meta.com header.s=s2048-2021-q4 header.b=G31xUuKC; arc=pass (i=1 spf=pass spfdomain=meta.com dkim=pass dkdomain=meta.com dmarc=pass fromdomain=meta.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=pass (p=REJECT sp=REJECT dis=NONE) header.from=meta.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g15-20020a50ee0f000000b0046b807c1a06si6429483eds.350.2022.12.08.10.25.24; Thu, 08 Dec 2022 10:25:42 -0800 (PST) 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; dkim=pass header.i=@meta.com header.s=s2048-2021-q4 header.b=G31xUuKC; arc=pass (i=1 spf=pass spfdomain=meta.com dkim=pass dkdomain=meta.com dmarc=pass fromdomain=meta.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=pass (p=REJECT sp=REJECT dis=NONE) header.from=meta.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229564AbiLHSBm (ORCPT + 72 others); Thu, 8 Dec 2022 13:01:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229591AbiLHSBi (ORCPT ); Thu, 8 Dec 2022 13:01:38 -0500 Received: from mx0b-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73138AD313; Thu, 8 Dec 2022 10:01:36 -0800 (PST) Received: from pps.filterd (m0148460.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B8Huh3m013851; Thu, 8 Dec 2022 10:01:14 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meta.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=s2048-2021-q4; bh=IKx0XOvt+Bq/1+YMwu6oCV2ooLxA/GlNshkW/f/mEW0=; b=G31xUuKCf+E5MPxQxZrpewvcXQKJFpvAOOczRXQ6HuccahxGyZ9MBVfRaAUCZnNEC3W5 Sw0/uBJW9BdvIsKO98EWOCflyJzurbr6YQZL00U7FbHl7w3r4cwSVS5432LitfLllg2J udSnxnQoEFC/nyf07aJcdbaRSVU1ITzonVfoQYMTiaE/fo8DyR9CFm8lYayT2TP66nkQ g4UQ3qGWwvndTkJzjEDnzKKmoa/gl3MOuCUVfPdM8YMsuB5oYUK99eDQ6bwp6JuZpiAI DgV7rUADCL9Gg3VyFG20cOzC/PABsbs7oO8Ebv3FvPrj6HpkGEHPDzjaZVmK8epvfYdo Ng== Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2107.outbound.protection.outlook.com [104.47.55.107]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3maqx7bgmr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Dec 2022 10:01:13 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XJyQorycgDOi1PqI9g4JPYszhh3/38yAU0k3jH7t8Vea4nCYVVhMHmpS+MFba/zHeBsdohWLoPlHZAYQkGWyGDA5b2MCnTxGj2KSobPIpKZCMLoRtXALEYWMo1tFHFiqys9mkAUJUGTOLZZGOTN1rjJPhUpwdnLHx+dc/dtJo2SPq7wfrlByypY2q5misEkLBDhk+kouvka8myuvHjpxzQ2rtXd043MQsNSUOJ7UQDgbJGw/CePRf+J0imdUHkWI5nvaPosphGO4xtP243SzmFSYG3YKI56rY70BFO+676kT48/zamVq0+oPBTSdCV1YAu5DsRXN89OFSatTdW58dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IKx0XOvt+Bq/1+YMwu6oCV2ooLxA/GlNshkW/f/mEW0=; b=GkTzQJMjEaDxIrwjMLq+jaiD2LUF+cgPrnEHXfGq6xCaM+Sv92H2DsCOYZda1XTvpDPxg60qdnYDa+5CrphkwpK0S95D700j2S0FM6Hm9tUPnfmIKSsJrajtk6F+ikN1gyZVJdEFiX3hdzqVMRAjEbZ59A8MaFq2e0uGKc6XeADBWn4wzrO7NDLDXiuFw/MboAEy0DRTNeUVDvHc5XxeGT61OY6yEOf8OH9zNRLLeYOF6bYEpfHDWBcx+V4pwLwR8xk0AZJZN7iEILAmeqOoY9VoYItzEcLlW7XtwmJFf7+o77B4CRxUKIhFMo3zH3SYu3rFNf0lNKpsnyu+dNkOVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=meta.com; dmarc=pass action=none header.from=meta.com; dkim=pass header.d=meta.com; arc=none Received: from SN6PR1501MB2064.namprd15.prod.outlook.com (2603:10b6:805:d::27) by CH3PR15MB5563.namprd15.prod.outlook.com (2603:10b6:610:144::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.8; Thu, 8 Dec 2022 18:01:11 +0000 Received: from SN6PR1501MB2064.namprd15.prod.outlook.com ([fe80::d665:7e05:61d1:aebf]) by SN6PR1501MB2064.namprd15.prod.outlook.com ([fe80::d665:7e05:61d1:aebf%7]) with mapi id 15.20.5880.014; Thu, 8 Dec 2022 18:01:11 +0000 Message-ID: <0b9023b6-9742-b317-7596-98026a0c5d03@meta.com> Date: Thu, 8 Dec 2022 10:01:08 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH bpf-next] bpf: btf: don't log ignored BTF mismatches Content-Language: en-US To: Connor O'Brien Cc: bpf@vger.kernel.org, Martin KaFai Lau , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , linux-kernel@vger.kernel.org References: <20221109024155.2810410-1-connoro@google.com> <5708a47d-5400-e75e-ccf6-96177366ea38@meta.com> From: Yonghong Song In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed X-ClientProxiedBy: BYAPR05CA0016.namprd05.prod.outlook.com (2603:10b6:a03:c0::29) To SN6PR1501MB2064.namprd15.prod.outlook.com (2603:10b6:805:d::27) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR1501MB2064:EE_|CH3PR15MB5563:EE_ X-MS-Office365-Filtering-Correlation-Id: 23bcd4b8-507d-495f-a95d-08dad9463090 X-FB-Source: Internal X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vAeib1NDmGqb+db/JdiBmFrn+4SfNBLBtgFnpKM98pJLiP3ysl8bsGYG5SLpp5VwWVs5EWypxu7BxhBH5ILKPgf35RVtv8eliOKc9pkNkb5Ke/aiXnfOHyCbHhTESf4JeEAOdvTgX7PuPhi0ipw1oMwShaJchfbtDu0/oFCgMZMTB1GjKmTvypsSjLWobHhHF/ta+1VAGPN5g9b/V/umDCxGB8qoaDsbtv4BeCrBHPdg5s0eoMJZUqzsKWpprclS8xTSUALEh1HUQU8h6kFHUOdWKw77/Okcjp20PpScM8NscbcRTgChLQ0Z++h/CXzFhFp43PDUeS/EWB0TYgZHUUsQaWDI5h7cy/k2q9TD3zanF/7D6zfqfJb1yfZZV1ebdv/g52m8tj/IVuUahjUT3KLWJec6TWlK44ZSIUCDeQHenTjPBaX4DbdqHGK+mzgdes9x86dJB5KJKMvYyL/S3NrKTC4vNWHP3ignN//o4gG3ZuQOYo8h4FIzGMRKA4XlO/Nl3NkBgaf3Yck9+1lCcfgbKTxaIpylhRbBe54gUd/qDu+2Oq2cIAAWaw2BHOGHs21WC/+mFOmIVx3jzenZZttLvOmWyNtb9bzQRmYRaKDY9UxKMeXATOpQcwOq+HQ1CFefLRc5/2wCPjYFHs5vVM/mrcovoOwe4vtIlXHvdVoWS+oQ8Mggv6+RFocVpdIRzDm+r16lBPXqvAlZPV3bhNEfbZIlAG8FHp1+KdJnwYXCctdQ0WfG1jnGJqheMjJaHQGJKo6NLgTytW06U6ByjPin6Ir9lY7jVXbo7QTHurM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR1501MB2064.namprd15.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(346002)(376002)(136003)(366004)(396003)(451199015)(5660300002)(7416002)(6506007)(53546011)(316002)(8936002)(4326008)(66476007)(66556008)(66946007)(2616005)(6916009)(38100700002)(54906003)(6512007)(186003)(86362001)(36756003)(31696002)(8676002)(41300700001)(83380400001)(6666004)(2906002)(31686004)(478600001)(6486002)(966005)(45980500001)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UnRWWEN5eTl6OHkwTDA1d21yUzJWMkgvcEhkRGZCYWlVM0p5OVF1SlVzTUdz?= =?utf-8?B?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V2bWlFUUNu?= =?utf-8?B?aEJGd09OdllUb29ONExiOVBhTmd0cjlUT3BOV29MVE9hbVJpVXh0NEVzdVBP?= =?utf-8?B?TDd4R3pRM0czQVNSZ0MxZk91UWlrcmk4WVE1M3FXd2ZsTEh0NkpWTFk1OXF2?= =?utf-8?B?WUppTTBOSHY1bTZpcEhjc3ZVMHQvTE0zNUpvZ3M5aXgxS2RVQ0lCYU04RTQz?= =?utf-8?B?cnRuUHBOeFFvTGU0MC9ydEorZXhvUWxHdGJOS1NYZXB3WjhWYzVpYmlYWkdp?= =?utf-8?B?amZPWnV1R2hYc2Fsdnd4bXVvN3FpZlYvcUd1ak1MUy9LTVpVME5LMERrejk3?= =?utf-8?B?RWc9PQ==?= X-OriginatorOrg: meta.com X-MS-Exchange-CrossTenant-Network-Message-Id: 23bcd4b8-507d-495f-a95d-08dad9463090 X-MS-Exchange-CrossTenant-AuthSource: SN6PR1501MB2064.namprd15.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2022 18:01:11.3633 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kb7Q91dBsCyJhisAix0ec0CeNCidEFS6IXyvzwO63Mjyty8JGfNC3a2C4FviZQud X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR15MB5563 X-Proofpoint-GUID: 6yK3DitxOpjlaHUbkjymcyWZRppE7dpm X-Proofpoint-ORIG-GUID: 6yK3DitxOpjlaHUbkjymcyWZRppE7dpm Content-Transfer-Encoding: 7bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-08_11,2022-12-08_01,2022-06-22_01 X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 12/7/22 6:19 PM, Connor O'Brien wrote: > On Wed, Nov 9, 2022 at 8:45 AM Yonghong Song wrote: >> >> >> >> On 11/8/22 6:41 PM, Connor O'Brien wrote: >>> Enabling CONFIG_MODULE_ALLOW_BTF_MISMATCH is an indication that BTF >>> mismatches are expected and module loading should proceed >>> anyway. Logging with pr_warn() on every one of these "benign" >>> mismatches creates unnecessary noise when many such modules are >>> loaded. Instead, limit logging to the case where a BTF mismatch >>> actually prevents a module form loading. >>> >>> Signed-off-by: Connor O'Brien >>> --- >>> kernel/bpf/btf.c | 7 ++++--- >>> 1 file changed, 4 insertions(+), 3 deletions(-) >>> >>> diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c >>> index 5579ff3a5b54..406370487413 100644 >>> --- a/kernel/bpf/btf.c >>> +++ b/kernel/bpf/btf.c >>> @@ -7190,11 +7190,12 @@ static int btf_module_notify(struct notifier_block *nb, unsigned long op, >>> } >>> btf = btf_parse_module(mod->name, mod->btf_data, mod->btf_data_size); >>> if (IS_ERR(btf)) { >>> - pr_warn("failed to validate module [%s] BTF: %ld\n", >>> - mod->name, PTR_ERR(btf)); >> >> I think such warning still useful even with >> CONFIG_MODULE_ALLOW_BTF_MISMATCH. >> Can we use pr_warn_ratelimited instead of pr_warn in the above to >> avoid excessive warnings? > > I gave this a try on a Pixel 6 but I'm not sure it quite addresses the > issue. The amount of logging doesn't seem to decrease much, I think > because the interval between loading one mismatched module and the > next can be greater than the default rate limit. To my mind, the issue > is the total volume of these messages more so than their rate. > > For context, Android devices using the GKI may load hundreds of > separately-built modules, and BTF mismatches are possible for any/all > of these. It was pointed out to me that btf_verifier_log_type can also > print several more lines per mismatched module. ~5 lines of logging > for each mismatched module can start to add up, in terms of both > overhead and the noise added to the kernel logs. > > This is more subjective but I think the warnings also read as though > this is a more serious failure that might prevent affected modules > from working correctly; anecdotally, I've gotten multiple questions > about them asking if something is broken. This can be a red herring > for anyone unfamiliar with BTF who is reading the logs to debug > unrelated issues. In the CONFIG_MODULE_ALLOW_BTF_MISMATCH=y case the > flood of warnings seems out of proportion to the actual result > (modules still load successfully, just without debug info) especially > since the user has explicitly enabled a config saying they expect > mismatches. > > If there needs to be some logging in the "mismatch allowed" case, > could an acceptable middle ground be to use pr_warn_once to send a So it looks like pr_warn_ratelimited still produces a lot of warning. In this case, I guess pr_warn_once should be okay. > single message reporting that mismatches were detected & module BTF > debug info might be unavailable? Alternatively, if we could opt out of > module BTF loading then that would also avoid this issue, but that's > already been proposed before ([1], [2]) so I thought working with the > existing config option might be preferred. > > [1] https://lore.kernel.org/bpf/20220209052141.140063-1-connoro@google.com/ > [2] https://lore.kernel.org/bpf/20221004222725.2813510-1-sdf@google.com/