Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4320883rwb; Mon, 31 Jul 2023 05:18:50 -0700 (PDT) X-Google-Smtp-Source: APBJJlHBwdEGqJwQemxPkvt3IUu5mmTpnPx5TUiFP/h2DE0lpBzhm6je52BZwip+5ffSK50/hMn+ X-Received: by 2002:a05:6a20:9381:b0:13e:14f9:294d with SMTP id x1-20020a056a20938100b0013e14f9294dmr980206pzh.58.1690805930406; Mon, 31 Jul 2023 05:18:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690805930; cv=none; d=google.com; s=arc-20160816; b=UPrTEUWCynJB9mUINGXR8wIBuDp9AOxKph9RQodE5eNqe6GEy5ULNQS0NFAbm39HJr vTFyYk/HohF41iu9GI0ba99GLJIGvlKRvf85N/lWYtfKJ8AJ6fmDgqvLNAFUxG0GIrpA +zEWYDfo8N+WNASrZNq6k8vwwwLW7AERwWWl9egAAkAmP0mjRPjeRXLVJePj31LSLcGU UA0mW9TmOSiUo5si5iTzvemroWGKrE6yl8qg7bqHZl1Ky8UrYZll3H0q2Gqp6IT68OZB I9NfW5FRqTD6XweUgXKxOAvRcHH485z+p8w9ZGnSCWj7jeplSNQ5ZKvzR/MffS9d+tF6 //pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=5vaUW0ZFNoavCkOsFWH4xJQw7j0BCOKV0sVk8cbQiFE=; fh=Ejtt3dFxnxi3yKhXZZY2OGvzdqp9Pq+UrfnS0/l9k7Q=; b=luPDh7G+1DjNUpsVSITyGs5kIIqpnuoUoz5nEsRfNVoa2INQAI1BV8+h7otIa/sYMu AmXpBN7qlhqLeIRTA+euE2UbTxngtjuZy8BcSqEM4ty3R0Q2ypvHgGLhftPCMvmSDW/S OICxYinHlAfsMny3ls0RxGrv7eW+yQp/CayE8DkQZGsYY079YiFFQ9J4W0Q54rJkf+Ya +9bWB3GQ401jPFJq/kIWe6nhKwQwzRBJYZKociQEtJldL+Bmu6o9AYPGNkigPtHS0UEL mZB9wSy/0qcqYrswS1hB2xluG5vASASbZDzbHvJTzunCl2PHN7LWHtxoO8T1/0dZ8wbB ECsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eKO+LazD; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u186-20020a6379c3000000b00546bab11218si6940488pgc.439.2023.07.31.05.18.37; Mon, 31 Jul 2023 05:18: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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eKO+LazD; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232588AbjGaLVv (ORCPT + 99 others); Mon, 31 Jul 2023 07:21:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232589AbjGaLVd (ORCPT ); Mon, 31 Jul 2023 07:21:33 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C1741986 for ; Mon, 31 Jul 2023 04:20:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690802428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5vaUW0ZFNoavCkOsFWH4xJQw7j0BCOKV0sVk8cbQiFE=; b=eKO+LazDU8zkB5jwlS7S7sb201HmttO4H8cJOWY+hnh0WS+G/54A449/A6eNkvRWff0HE1 pLi/UE3KUGcCii+C9ZPrUkceSO+XyYtIZwUUHaTsaegkNo3yorr0vahcyGoz2z8EpK3NPk ADdhwMNqMI+pgBho8gZYxMZ/kwXcnRo= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-479-r6Ks0MrkOYCkY_l9KWH--g-1; Mon, 31 Jul 2023 07:20:24 -0400 X-MC-Unique: r6Ks0MrkOYCkY_l9KWH--g-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-63cf5bb17c6so56979536d6.0 for ; Mon, 31 Jul 2023 04:20:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690802424; x=1691407224; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5vaUW0ZFNoavCkOsFWH4xJQw7j0BCOKV0sVk8cbQiFE=; b=eutRdSK+yv3bE7q00uAfhWJ9ipqpbBQYTrNzOAqIsy99FnA/QbOffnzg+XIH1FW2Cp +Hrk/g/X47G2n9ChpVju1ZErZ4XCIJK2RlM0I6RdNGJk8mlaE4D89UsSdD84EnOXVm50 i6QwuqXCIE/OfDQw0SRe1Jz9VPdAsyiIxc6kgXEuOaIhwpdhJWiqEJMXFFRgoZ35HEP5 rJImK12p3Ut/ouagfes9kkuJBb2UkgoBVrxx0LPzkKpyN/O/hTIO4523o5gD3iLCx9rW afxbfbI4TCtFD1A28wnYeco0ODUlXJD1uwc3xFAV+AhRUn+nUkL8353bEwz+/0zwT75D RiGw== X-Gm-Message-State: ABy/qLal/lvdNSJCMRH4eekCdQYAJi2efw2nGFjbPJUv+2NaE3l5OMsp Egcl6tFmDXGX+ms3BOlQts8eghM13iO/1Zr83kkYa73P4DSixFJvMV3ulEZ/pSzGU+ERTS7oLAl 8JeyR7q51rc7C6015OgED9UZ9 X-Received: by 2002:a05:620a:3199:b0:765:a678:977c with SMTP id bi25-20020a05620a319900b00765a678977cmr11440907qkb.67.1690802424231; Mon, 31 Jul 2023 04:20:24 -0700 (PDT) X-Received: by 2002:a05:620a:3199:b0:765:a678:977c with SMTP id bi25-20020a05620a319900b00765a678977cmr11440851qkb.67.1690802423943; Mon, 31 Jul 2023 04:20:23 -0700 (PDT) Received: from vschneid.remote.csb ([149.12.7.81]) by smtp.gmail.com with ESMTPSA id c23-20020a05620a11b700b00767303dc070sm3206663qkk.8.2023.07.31.04.20.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 04:20:23 -0700 (PDT) From: Valentin Schneider To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-doc@vger.kernel.org, kvm@vger.kernel.org, linux-mm@kvack.org, bpf@vger.kernel.org, x86@kernel.org, rcu@vger.kernel.org, linux-kselftest@vger.kernel.org, Masami Hiramatsu , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Paolo Bonzini , Wanpeng Li , Vitaly Kuznetsov , Andy Lutomirski , Peter Zijlstra , Frederic Weisbecker , "Paul E. McKenney" , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Andrew Morton , Uladzislau Rezki , Christoph Hellwig , Lorenzo Stoakes , Josh Poimboeuf , Jason Baron , Kees Cook , Sami Tolvanen , Ard Biesheuvel , Nicholas Piggin , Juerg Haefliger , Nicolas Saenz Julienne , "Kirill A. Shutemov" , Nadav Amit , Dan Carpenter , Chuang Wang , Yang Jihong , Petr Mladek , "Jason A. Donenfeld" , Song Liu , Julian Pidancet , Tom Lendacky , Dionna Glaze , Thomas =?utf-8?Q?Wei=C3=9Fschuh?= , Juri Lelli , Daniel Bristot de Oliveira , Marcelo Tosatti , Yair Podemsky Subject: Re: [RFC PATCH v2 05/20] tracing/filters: Optimise cpumask vs cpumask filtering when user mask is a single CPU In-Reply-To: <20230729153436.1e07bfa6@rorschach.local.home> References: <20230720163056.2564824-1-vschneid@redhat.com> <20230720163056.2564824-6-vschneid@redhat.com> <20230729153436.1e07bfa6@rorschach.local.home> Date: Mon, 31 Jul 2023 12:20:13 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 29/07/23 15:34, Steven Rostedt wrote: > On Thu, 20 Jul 2023 17:30:41 +0100 > Valentin Schneider wrote: > >> /* Move along */ >> i++; >> + >> + /* >> + * Optimisation: if the user-provided mask has a weight of one >> + * then we can treat it as a scalar input. >> + */ >> + single = cpumask_weight(pred->mask) == 1; >> + if (single && field->filter_type == FILTER_CPUMASK) { >> + pred->val = cpumask_first(pred->mask); >> + kfree(pred->mask); > > Don't we need: > pred->mask = NULL; > > here, or the free_predicate() will cause a double free? > We do, thanks for spotting this. > -- Steve > >> + } >> +