Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp921096pxb; Fri, 22 Apr 2022 14:21:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwD2gCYu5r+KiuC8pAqS2yoHZSAoVlqTCE1TXwQwxKWM6/X2+vVzj8n6ylwAVdcitQIS3mQ X-Received: by 2002:a05:6a00:14cb:b0:50a:7e08:e1fc with SMTP id w11-20020a056a0014cb00b0050a7e08e1fcmr6914487pfu.12.1650662474044; Fri, 22 Apr 2022 14:21:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650662474; cv=none; d=google.com; s=arc-20160816; b=mRisZm/2YAbLzP499yiThO+fSpvnfQugQ3JSU9XxG5YwRSyw3auI10ryYOe8LU0HBl /bz0JZMCKe71dzR+dtMOURDrgPM7BHd/gV49EhN3h5u9dhw3OCagmux6515Q0a4PVr6G r2nvZTwyBJ6jZDME9RtV54HFHV92iakU7KnS0AjGLAn1OQz0/5BJ9WqJ6leemCO3SeMU EVPaiU3C5X5F7n8pb/mjiPoQwvmyEofubkRsyUSmP9gpke1JSOWMkHNDBkKZ5IDm0mNr k/+n1QBUHz+dHD3uuU6zoT4gI3orpDIpE08/OaXL7uXrSOuwIi0opRFivQacY83m7oaA KL7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:dkim-signature:dkim-filter; bh=633pQxxAWd4+mVGElSVB2wU4Sye2IG1UF5utL7p1Dgc=; b=HRVuZxn7dBltGR9JUBXOlrhEzzrqXwa0jo/0KrBaNaaNkitVEQQgKePnf4qyy7q9F8 jqNlP9s+gn3X53dEKqWxGesVKLYUVfn3O0sY5ETdCXHGMqhp92AShTWmNedoNnbrRxdf yMa+mcG8fp5hvPrSwxKBXnlohPxdw7HtgenLaxSqivob3Tw5S0COyK7++gZ9cRI8zyOK 0XOCduVtdjOsPe15F+/K+IMF0HzeT2yEXf7pUXP43cRtKvnix6o6CCB8fMhTp+wpXQ3l z0d9iKgaMxHZzItW8qiFGz7r/ZpF5keU70m3y2ETwaNV4moE0hjBHi7D4lSl7AffVtKb Kynw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=R3sE6GhI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 14-20020a63000e000000b0039db9d05814si9407641pga.543.2022.04.22.14.21.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 14:21:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=R3sE6GhI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1B8901D83AD; Fri, 22 Apr 2022 12:28:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353451AbiDSOid (ORCPT + 99 others); Tue, 19 Apr 2022 10:38:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353415AbiDSOib (ORCPT ); Tue, 19 Apr 2022 10:38:31 -0400 Received: from mail.efficios.com (mail.efficios.com [167.114.26.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C32C20182; Tue, 19 Apr 2022 07:35:47 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 4BFCF3C56FF; Tue, 19 Apr 2022 10:35:46 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id R-VnQ2zxcchr; Tue, 19 Apr 2022 10:35:45 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id A522F3C53DD; Tue, 19 Apr 2022 10:35:45 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com A522F3C53DD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1650378945; bh=633pQxxAWd4+mVGElSVB2wU4Sye2IG1UF5utL7p1Dgc=; h=Date:From:To:Message-ID:MIME-Version; b=R3sE6GhItWuYLql2uY0aAmuhV+/PQ9OW2IiW5iv3B9ErZm2vXI0CE83vlPXsmRpts Pn49ntvqG+jlIK9iVxp0csKdQy+AK0lyskyeBvAKPefIp59JIZXc37weBZbeIssSAs izuwiMeBFGbSClXT1xNkAUbGQ7mSzNQuOTRCvoED3yqAOh2O9FsSD1XZ5atKJyx6JY v6llS0In4AglWGW/4MRkLGJmMCzsoofaSRTvuBbFPLCJ4vlj4elKmu9HWycYR5KS+a MONTULd35JDGz0dVWjEByWsZBaIar90weJPqi9O0+QFlJb9SZ2M6Q97xgF9PGpWpjy U/o0QciyKc+6w== X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id CLySuEcIvIqG; Tue, 19 Apr 2022 10:35:45 -0400 (EDT) Received: from mail03.efficios.com (mail03.efficios.com [167.114.26.124]) by mail.efficios.com (Postfix) with ESMTP id 98BDD3C5747; Tue, 19 Apr 2022 10:35:45 -0400 (EDT) Date: Tue, 19 Apr 2022 10:35:45 -0400 (EDT) From: Mathieu Desnoyers To: Beau Belgrave Cc: rostedt , Masami Hiramatsu , linux-trace-devel , linux-kernel , linux-arch Message-ID: <337584634.26921.1650378945485.JavaMail.zimbra@efficios.com> In-Reply-To: <20220401234309.21252-7-beaub@linux.microsoft.com> References: <20220401234309.21252-1-beaub@linux.microsoft.com> <20220401234309.21252-7-beaub@linux.microsoft.com> Subject: Re: [PATCH 6/7] tracing/user_events: Use bits vs bytes for enabled status page data MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.26.124] X-Mailer: Zimbra 8.8.15_GA_4257 (ZimbraWebClient - FF99 (Linux)/8.8.15_GA_4257) Thread-Topic: tracing/user_events: Use bits vs bytes for enabled status page data Thread-Index: 3mhe0Mcep7c7n2Jzj66zR4QLGQO38A== X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no 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 Apr 1, 2022, at 7:43 PM, Beau Belgrave beaub@linux.microsoft.com wrote: > User processes may require many events and when they do the cache > performance of a byte index status check is less ideal than a bit index. > The previous event limit per-page was 4096, the new limit is 32,768. > > This change adds a mask property to the user_reg struct. Programs check > that the byte at status_index has a bit set by ANDing the status_mask. > > Link: > https://lore.kernel.org/all/2059213643.196683.1648499088753.JavaMail.zimbra@efficios.com/ > > Suggested-by: Mathieu Desnoyers > Signed-off-by: Beau Belgrave Hi Beau, Considering this will be used in a fast-path, why choose bytewise loads for the byte at status_index and the status_mask ? I'm concerned about the performance penalty associated with partial register stalls when working with bytewise ALU operations rather than operations using the entire registers. Ideally I would be tempted to use "unsigned long" type (32-bit on 32-bit binaries and 64-bit on 64-bit binaries) for both the array access and the status mask, but this brings extra complexity for 32-bit compat handling. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com