Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2738740rwb; Sat, 29 Jul 2023 12:56:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlF+fN21MCJenSvHPF2VGnt7xYjYzC/LRMLKK1mZRnAP+ldASMRAHHoP49iRsWXnJpEbedrM X-Received: by 2002:a05:6a00:240a:b0:682:b6c8:2eb with SMTP id z10-20020a056a00240a00b00682b6c802ebmr6321307pfh.1.1690660599206; Sat, 29 Jul 2023 12:56:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690660599; cv=none; d=google.com; s=arc-20160816; b=jQxMkAaRhib+QoD7xHUDKpKhBtenmH3w/Q9Igw6zYCDOQ8O+52sTGM/4vIoSnkcAKb ZwifPResjOhC9nTjRBquix+aV+Q7DeBo6h41t6yZfW9Y+VsA5anS62minPgTK4p+GBae db5Q96HFuUyDTrxSfOMQqBhMQ5rXH7GpOCsMO4IW4+mEj4LZzRd86nWz3M2/sS0Q6MbC cfUQvmPhPBqozZBnDAoZZpNi8P2dHXRAX1r73YxTYt6JdBaSP/vq+vpzVsuvI7HprYga ZqdUIlZo2+pk7RYhqCX6ag2VfJ8ak9ztTpNbZGt1fRgyDuhZ8M+LbqRF5HApZ3t74ZcY gaOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=tVj6IBxUJBK4YUD7tPaZKYWvUxMow7Tl+0/fIlafWUs=; fh=3KuZ0M+Yi+tte/s7IQ3weUkTaeJvZGvlQtl/qM5CMHE=; b=0LkTgq9/I4QqHtdSpjzhaKt0Ut3radzQtupaUcN0wiFNU1vm8kmJ4MYZSjkX3TCwJw d6lcjkN6v4NrKWSaAzJvvipnvNBY5KHr8xOhj1nK3nvoDmbF/yI8xGmVa910ab0IAKCN 9RpJ9wx4xghzmezyGfxtPTtt6prhZp5gYqMx2K/EsMs4PMbCmAkOPiUPaUJHrVDrw/+K bWS/ORh3balrsGUk7CD5wRLX5jk+6GRKJPfFzqGLzO/fBjrUCpykDYkY9lISQXficLfa 00iE7SQ+Fk73SVcFGYVoPifc/uUYBQXTiwe7Mbv/DKb9MFnYgfmZk/uACVOpUutSxJTy 6Kjw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s203-20020a632cd4000000b0055c8f4a56d5si4789333pgs.600.2023.07.29.12.56.22; Sat, 29 Jul 2023 12:56:39 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229836AbjG2Ter (ORCPT + 99 others); Sat, 29 Jul 2023 15:34:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbjG2Teq (ORCPT ); Sat, 29 Jul 2023 15:34:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20A99CE; Sat, 29 Jul 2023 12:34:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B102C601D6; Sat, 29 Jul 2023 19:34:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27432C433C8; Sat, 29 Jul 2023 19:34:38 +0000 (UTC) Date: Sat, 29 Jul 2023 15:34:36 -0400 From: Steven Rostedt To: Valentin Schneider 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?B?V2Vpw59zY2h1aA==?= , 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 Message-ID: <20230729153436.1e07bfa6@rorschach.local.home> In-Reply-To: <20230720163056.2564824-6-vschneid@redhat.com> References: <20230720163056.2564824-1-vschneid@redhat.com> <20230720163056.2564824-6-vschneid@redhat.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 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? -- Steve > + } > +