Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1671132ybx; Thu, 31 Oct 2019 14:10:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqXu6mknHQq+46754D7yCSs4L0NQq70WrqwInYWVfMqowMe0LWBi05mKQr/lUUfM/inkP2 X-Received: by 2002:a17:906:48c5:: with SMTP id d5mr6404988ejt.167.1572556225618; Thu, 31 Oct 2019 14:10:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572556225; cv=none; d=google.com; s=arc-20160816; b=pCRfGmPzIHpRIM4YrbnssQBCenTjrrXOK77CKFJrayPHQuKu8bIJnEmyIv38O/+1Jj ucWTnnTBiuq3DMLeNeqoE7j7WC9APrZcCSUze8eo6c7Rlexh46nqbO1G3mFVvpUQ+3R6 lBGKO+oZcVZwdHKGvBguh9r1/CXvWhW4h/yFs+lVMAI5+MYg9GzsxTOYgFf21s/d17lm 5tBTynObSVy+3ISqcn2CFqrWalmcdNX5HES5xxeS3S4EQcO6aNyCYEKUXpSIbou4+0Ba nk7wrEQxmnjTKTv78NACarpx20YS4pHG2d3m56J3VHBcMxWTvNaNbkgkyr15gjqSAalj 5V5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=5fMqgxCz9YeELky5sdMvqRGe8oe8TryFm0ddjx2jFJ8=; b=CmvMfBkjCn2kzPGGRggls9318YKjygQ48zBhSc8nSUsZxfRXIAryMVaY6MEPdAr6ft 9PWbBqZ3zTNQWn5ANTSQlgfkdQsYSH+8gHElx7xFLo4hS+li04xaN3rA9DUBklCVuxRY aczmRUKqRZ8hStRo6zeNpY1qjgv6DxaZN+WL3l1HHXS3xnlPophd4vFGX8/TGUzdTB3y cNk2FSh3p6cYwV6/Fz9RjcZRcaNtCgcI1nKiilhHbT6y1v09okHrdMVuCnO3izRK4A2+ Kdta7+pAcdlflscMV7QVbSvEErcpkm9g8d8cUi/tlHkwXrtnw2xtGwKBvB6rIfHWnbEF i4qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r2LAcakq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r20si5433612edb.197.2019.10.31.14.10.01; Thu, 31 Oct 2019 14:10:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r2LAcakq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728512AbfJaP5j (ORCPT + 99 others); Thu, 31 Oct 2019 11:57:39 -0400 Received: from mail-il1-f193.google.com ([209.85.166.193]:39213 "EHLO mail-il1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727593AbfJaP5j (ORCPT ); Thu, 31 Oct 2019 11:57:39 -0400 Received: by mail-il1-f193.google.com with SMTP id f201so181615ilh.6; Thu, 31 Oct 2019 08:57:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5fMqgxCz9YeELky5sdMvqRGe8oe8TryFm0ddjx2jFJ8=; b=r2LAcakqEaUTEWVB42o7netz4E9VSlpCiF1h3M4FyqmZMW8hARpE28IicCl+YOx7cK wIYdFj49qzwuextspvTS4pX+SXfjLIQH5ePcrW24wrFI2FLPYPUJWlXcZK5vfQUYH0vM LDVsW0NrfZXiJiuQa2lgvWH+vqp5PLuOBFuN8dfnoxXb2ChS8BlOoPnJ44oH3vCkeE9r e7EaZZse7IDcGaylRdktf7O2XJMiLmms8LvvHOLxS4oGNFpEZb+kY2i5x5SAxqU2Otni sHQPudwD1eG2lPICtrGXqx1E0CmeCqZbtDV3Yd397iWEVLyCsSkk9zsjZIBQpoEfEhlU fUHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5fMqgxCz9YeELky5sdMvqRGe8oe8TryFm0ddjx2jFJ8=; b=tYJhUQYiPRhWk8CfaGeWA3C5WNuKjTxAuxGp2qT3xpch3eF6+rCKblZviMmMWG1iBk MuvxK3faCpJ+QfaXjW2FAXDz0gM8ueRVGujVMMsDwK8P0YlYKKfJM9gMWQSvbQo35JSn iQh1u8a6juw9opcB5NN642tlHdM4NQpp21QkLETaDaSVIWIQgzTjabJI965EmV/D/v6H CLHZEs5WFxB4VWd5LuysjnqTibuHL6NGLoxRgM8TQL4W1eAQlHjg4NsjQOfUG/GSnzJA 64PBJLCNUUWW/wJqprnV5m65hZtmb6f/EwzZPiR0rqHvEIHtSDyfSgJOjgzY+V75jWzJ Vbwg== X-Gm-Message-State: APjAAAUpnn9DIRCzU8vhxC8K2Fk8DXI1JWSCdQ9TAPn8hxEm07AYse8d nHy42b5LFHhwGJ7JNi+yMjRocNiCMQS6AVz6iHA= X-Received: by 2002:a92:b656:: with SMTP id s83mr6910636ili.282.1572537457279; Thu, 31 Oct 2019 08:57:37 -0700 (PDT) MIME-Version: 1.0 References: <157186182463.3995.13922458878706311997.stgit@warthog.procyon.org.uk> <157186186167.3995.7568100174393739543.stgit@warthog.procyon.org.uk> <4892d186-8eb0-a282-e7e6-e79958431a54@rasmusvillemoes.dk> <16620.1572534687@warthog.procyon.org.uk> In-Reply-To: <16620.1572534687@warthog.procyon.org.uk> From: Ilya Dryomov Date: Thu, 31 Oct 2019 16:57:53 +0100 Message-ID: Subject: Re: [RFC PATCH 04/10] pipe: Use head and tail pointers for the ring, not cursor and length [ver #2] To: David Howells Cc: Rasmus Villemoes , Linus Torvalds , Greg Kroah-Hartman , Peter Zijlstra , nicolas.dichtel@6wind.com, raven@themaw.net, Christian Brauner , keyrings@vger.kernel.org, linux-usb@vger.kernel.org, linux-block , linux-security-module@vger.kernel.org, linux-fsdevel , linux-api@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 31, 2019 at 4:11 PM David Howells wrote: > > How about: > > * We use head and tail indices that aren't masked off, except at the > * point of dereference, but rather they're allowed to wrap naturally. > * This means there isn't a dead spot in the buffer, provided the ring > * size is a power of two and <= 2^31. To me "provided" reads like this thing works without a dead spot or with a dead spot, depending on whether the condition is met. I would say: > * This means there isn't a dead spot in the buffer, but the ring > * size has to be a power of two and <= 2^31. Thanks, Ilya