Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp154763lqp; Tue, 11 Jun 2024 18:57:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXFkUyyw2Q+IRXv4SdtOQxmVh3Nt03+zwf3uybhsPk49D8q55A7Q+NnCt+ur4raIUF0fi8LqlsCvuF6Eikf7fVThg+T3aRSBHnucVSDtg== X-Google-Smtp-Source: AGHT+IG9dm+5NOSmgBrszo7AJRX45nNEMUEau0q758tFqkuiPikp5BcYumH+ru2o09T+shVbWRYl X-Received: by 2002:a50:d65a:0:b0:57c:5d4a:4122 with SMTP id 4fb4d7f45d1cf-57ca978fc0dmr302655a12.9.1718157449185; Tue, 11 Jun 2024 18:57:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718157449; cv=pass; d=google.com; s=arc-20160816; b=VWs41yJxhOGTgnQB6yTQIjw8r0Is5nEOtccFaNSiSym1JeQQ5OHydUKmIvzpVLOjah DL5cc2M5thyG+22+fd5cHF9UUrxepbdoBVJrG/Lyq2vmoKHQAKTO02x6nh3R+qogMP5B fVMWzt9PgFdAuYCT91EJhnXnC28jeHMVi1jzcj32MFd4Uh1Z2aDY/Wtj6S5DJqmD+iR9 DBgZEOIIL+HLMDY2PkHw3Hoc0HxW/rwYsjqIGl9UVb6Nx4dVlQq/aUwdLqZSSW4/NVhD 0db/pgDzcS5neo4hDV1SX9evSq5rAAAq2DWt4vIQZsl9JEQJQmD+n6leQOEoxYkk40o/ Vvfw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=p9Br5To/XYiWzhiY0iCgmT90PCKLbovjnIoDp43Djz4=; fh=ygHBm8Hvg4EsI4YPKY53uoEPnlZS6UQ3KR+aUqFMzP8=; b=ex0UPmJ4LBN7IlYiXvv3EiOBCst8atS8q/aWkabuC8EQSZZOdVHwGUAyV2b2lLNyLa GilcvEkKfi9QtmiPOpMW0Qhuf3ABMGBCJp13ZRMhY8hT97kJt1ksv+8sQKyfNJGISlOM 7hw++rUulKatzwiEWfr7PL9GWxkO/WLEiCDIdXdg40ZgvgxoRnKSl5/C5eUedgTd0M7W mXM0ld1FkPj+Vm/blV5s6sbpQUGkFqMwmc0KOkuDJCaoAeVN6gqVfI/5j5zI1kPE8CFn BEnEyCpClpjlF8tJQ5W1Y9+pFCNWdFrG07h5qqnlX68YeivAyEalSVBgB3+02wUl4Qjg VhPA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-210786-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210786-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c7587f1e9si3608571a12.198.2024.06.11.18.57.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 18:57:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210786-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-210786-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210786-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E2C481F235E2 for ; Wed, 12 Jun 2024 01:57:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 618525CAC; Wed, 12 Jun 2024 01:57:25 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D64A1A34; Wed, 12 Jun 2024 01:57:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718157444; cv=none; b=q1WhhjWxMa5Myrwt1RsaDucarh8GWP2s+yHlPAx0RGc6qy8MKAYJqqFzJvbC0nqETo1sQ5hc6jw6t89Ulakfowvc2UgZqYGj1ngRZV5957+4eqxpxicOIlW9AvODYxLX7zLQskVTVF7M8TRL/zW0ZwYlRrn1rqzbjjk27QAGQQc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718157444; c=relaxed/simple; bh=nqtVS0YOHFw+plikSyA0GPU+Oh9i+6nEHh2WeQDmHrA=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=kN94/yQONOkHGuUFibfKSclzlxWLXNEuR7ipUnrIZFPg95Z23ffcsxOXnvjQ7H/RYkRRGAh0amMbeQlZPieyDRhCMuDe8hEZVkYZ37YqeCsUF7sGopzD/MfPCUI9N/kbymYToEqOy3Z1Sv7XNsBps698EOUVDXtAVLWpfsDb/mc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39D80C2BD10; Wed, 12 Jun 2024 01:57:20 +0000 (UTC) Date: Tue, 11 Jun 2024 21:57:18 -0400 From: Steven Rostedt To: Guenter Roeck Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Vincent Donnefort , Joel Fernandes , Daniel Bristot de Oliveira , Ingo Molnar , Peter Zijlstra , suleiman@google.com, Thomas Gleixner , Vineeth Pillai , Youssef Esmat , Beau Belgrave , Alexander Graf , Baoquan He , Borislav Petkov , "Paul E. McKenney" , David Howells , Mike Rapoport , Dave Hansen , Tony Luck , Ross Zwisler , Kees Cook Subject: Re: [PATCH v4 01/13] ring-buffer: Allow mapped field to be set without mapping Message-ID: <20240611215718.03eb9fc0@rorschach.local.home> In-Reply-To: <20240611213937.408770fa@rorschach.local.home> References: <20240611192828.691638177@goodmis.org> <20240611192907.402447387@goodmis.org> <5178e22b-0c00-48d2-8a6e-85510706f145@roeck-us.net> <20240611185319.58a52a1b@gandalf.local.home> <1e74c6d8-ae74-49c2-bdc4-d9880110ab57@roeck-us.net> <20240611213937.408770fa@rorschach.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 11 Jun 2024 21:39:37 -0400 Steven Rostedt wrote: > > > > Maybe explain why sometimes __rb_inc_dec_mapped() is called to > > increment or decrement ->mapped, and sometimes it id done directly ? > > I can see that the function also acquires the buffer mutex, which > > isn't needed at the places where mapped is incremented/decremented > > directly, but common code would still be nice, and it is odd to see > > over/underflows handled sometimes but not always. > > Sure. I'll add comments explaining more. And I found a bug with this code. It assumes that mapped will be equal to 1 if it's the last mapping. That will no longer be the case. -- Steve