From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A5C7C27C4F for ; Sun, 23 Jun 2024 22:21:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C8F586B0496; Sun, 23 Jun 2024 18:21:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C3FA66B0497; Sun, 23 Jun 2024 18:21:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B07626B0498; Sun, 23 Jun 2024 18:21:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 928226B0496 for ; Sun, 23 Jun 2024 18:21:45 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 1B363160924 for ; Sun, 23 Jun 2024 22:21:45 +0000 (UTC) X-FDA: 82263576570.28.D1C549A Received: from out-181.mta1.migadu.com (out-181.mta1.migadu.com [95.215.58.181]) by imf05.hostedemail.com (Postfix) with ESMTP id B0D1E100005 for ; Sun, 23 Jun 2024 22:21:42 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=ulZaUDdR; spf=pass (imf05.hostedemail.com: domain of kent.overstreet@linux.dev designates 95.215.58.181 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719181291; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=zmWP1icMJZcxscx4T7pr7aUXM8WbtI7ppH47QYQ42+0=; b=v1I9yQBS7h7T06zeozVwEW8OZ6h4L/WA/mSlqzJsfEWlCBnOzc7IQ1A6H94zK+vArhxoll rJPPZnx61UGNS/Y0bUDU+EMFPNAJhIDldBhxenWxfCSBY1Mdr/2xt53Daqqrb+ntScM2MV CD6RkufML6p49FKZqydT5seFxMx+JrM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719181291; a=rsa-sha256; cv=none; b=6gcF/CH0WOmjkzeGTtfpYeWpsD0fbmfXrulYN+/Uiea3RqbPkvRf+dv3cJn5BB5GWZJT/e nG0MPcZTKZE2lYpoeAw7apYIjxyNr0foRdGojIEeakzijLAwPrnmbC0tX2OhfdX07QKbuv AFbsZ2bcGZiAm1eo14e+tZelG3mveP4= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=ulZaUDdR; spf=pass (imf05.hostedemail.com: domain of kent.overstreet@linux.dev designates 95.215.58.181 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Envelope-To: tglx@linutronix.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1719181300; 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=zmWP1icMJZcxscx4T7pr7aUXM8WbtI7ppH47QYQ42+0=; b=ulZaUDdRAdR0NGqH4EqH3ur2XkUNiW/qVDr5iGUw65QVgOqy77v6MABJkgVEmY5Hu6u6H8 wFmaljExGf12YVaYSvRWiESnuHHxyFERLyBhb519bu3MbDW+YkJezhBJleg+uCrK58wSfv Hz3Enxb5zVv9fcBUEk+Bjx1eKYXmdc0= X-Envelope-To: linux-fsdevel@vger.kernel.org X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: axboe@kernel.dk X-Envelope-To: brauner@kernel.org X-Envelope-To: viro@zeniv.linux.org.uk X-Envelope-To: bernd.schubert@fastmail.fm X-Envelope-To: linux-mm@kvack.org X-Envelope-To: josef@toxicpanda.com Date: Sun, 23 Jun 2024 18:21:36 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Thomas Gleixner Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jens Axboe , brauner@kernel.org, viro@zeniv.linux.org.uk, Bernd Schubert , linux-mm@kvack.org, Josef Bacik Subject: Re: [PATCH 3/5] fs: sys_ringbuffer Message-ID: References: <20240603003306.2030491-1-kent.overstreet@linux.dev> <20240603003306.2030491-4-kent.overstreet@linux.dev> <87frt39ujz.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87frt39ujz.ffs@tglx> X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: B0D1E100005 X-Stat-Signature: ytjzi1ddwjtu1pbfjzppgbrbuc8jcnyz X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1719181302-100284 X-HE-Meta: U2FsdGVkX19h47CVjGkfMkqffM8sRck/3NrfrrJyw2kSNwmbPAVpbh29IbTn/6h7UI3GOpKY9q3S82IgRrYcKm0EfO2Wr8DTO9do0gYWflupSJnJWQOUzxrjPTkBT40dqVwMKNU2s12/pVf+Imxe7G85AkdreaGKcStQwDzluw309+BIp0Y8ldINXMY9YSsBBCCNd3g8aUeHJJlG/V9/YOP+Vf6u6/3YG+R5PTzWHStu3Yiy1YPc/a5NRQa0sqZ7lE2aDOG5o8i6CK6Umapg7hiJNriThLCQdcucYokjOeAWTaI6x069GGfLw7fhqVsvxCkQNWr0wHLjx5Oo2unckMnmqykADE1l2TQ/3R/1GNkDc+LWQU3bMby2UX0cuytpreIIHskog6Bdgui1RXVDc6Uoqqr4afoFDw4OV4m+t1zGMh7/qZp5Ct3o2tzrdnegfSN6gIdggcPGU/q6baNX7yWHw2imWUata8V3Mj1JT82Q7HYjOrBIxl2+pmZ/7pM0M3Pml47AJdN6+3pzSdNo8MKep2AgN72BOAE7DtdQcrk4A2qftzDo4gBcYO1rRTHAM96tnHFjGVeU2NU+g5RzrP9H1zggjrY39m+BOK6K4pSjnI+xcULC8Kf6kqFHncGXTOnxiSrc/5T2WezwQxWCaJW8Eiq+OfTZOAzhGrNzSgCHqI448ZwZ3EY2CJDo5l3SnpmQ5th6erSb24U2oJZAzhx4QQuWkVee00wXKthNCV//zX/ZXO7mx5PJRplSrhTzVruetempB+Vi3eTp5B2ey4U5moVDCFPoTWzyVK7ADl/S1OAhR9Wt9y8883B3CyytsR0fvV50ReXe62FRabmpEhY1FMDvkarkwa9V5WfNmFBtv93GFa+8b4U9HuTR1qlzU+5TpmOCtGeUH1PZ2rfBmY3aZb6nD/38jCy8ryY/RW4idTJXv8Gbkuox/U1FASlvZbNiKV2m3Yh6mZvOSxD uchi2g5P MWCNNUdphb8LmfM9Sjo4fRvbwWcXrWORI7BauEUBBPUA4CUrWpDjHPVmFeAClvefNzEVtNG+02j71KWkSvjMcDHQUakXNNDBdOQckCJyBDaBBKjsZdK8dAGzOl/WPI60CDjqxdmmutwdQLOcnpA6fnjf5Aam8B0N7ezni X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Mon, Jun 24, 2024 at 12:13:36AM +0200, Thomas Gleixner wrote: > Kent! > > On Sun, Jun 02 2024 at 20:33, Kent Overstreet wrote: > > +/* > > + * ringbuffer_ptrs - head and tail pointers for a ringbuffer, mappped to > > + * userspace: > > + */ > > +struct ringbuffer_ptrs { > > The naming is confusing. ringbuffer_ctrl or something like that would be > more clear because it's more than just the pointers, which are in fact > positions. You have size, mask ... too, no? I like that name, yeah. > > + /* > > + * We use u32s because this type is shared between the kernel and > > + * userspace - ulong/size_t won't work here, we might be 32bit userland > > + * and 64 bit kernel, and u64 would be preferable (reduced probability > > + * of ABA) but not all architectures can atomically read/write to a u64; > > + * we need to avoid torn reads/writes. > > union rbmagic { > u64 __val64; > struct { > // TOOTIRED: Add big/little endian voodoo > u32 __val32; > u32 __unused; > }; > }; > > Plus a bunch of accessors which depend on BITS_PER_LONG, no? Not sure I follow? I know biendian machines exist, but I've never heard of both big and little endian being used at the same time. Nor why we'd care about BITS_PER_LONG? This just uses fixed size integer types.