From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([198.137.202.133]:41434 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728766AbeKJRZc (ORCPT ); Sat, 10 Nov 2018 12:25:32 -0500 Date: Fri, 9 Nov 2018 23:41:25 -0800 From: Matthew Wilcox To: Waiman Long Cc: "Luis R. Rodriguez" , Kees Cook , Andrew Morton , Jonathan Corbet , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org, Al Viro , "Eric W. Biederman" , Takashi Iwai , Davidlohr Bueso , Manfred Spraul Subject: Re: [PATCH v11 2/3] ipc: Conserve sequence numbers in ipcmni_extend mode Message-ID: <20181110074125.GB21824@bombadil.infradead.org> References: <1541794292-19425-1-git-send-email-longman@redhat.com> <1541794292-19425-3-git-send-email-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1541794292-19425-3-git-send-email-longman@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Nov 09, 2018 at 03:11:31PM -0500, Waiman Long wrote: > The mixing in of a sequence number into the IPC IDs is probably to > avoid ID reuse in userspace as much as possible. With ipcmni_extend > mode, the number of usable sequence numbers is greatly reduced leading > to higher chance of ID reuse. > > To address this issue, we need to conserve the sequence number space > as much as possible. Right now, the sequence number is incremented > for every new ID created. In reality, we only need to increment the > sequence number when one or more IDs have been removed previously to > make sure that those IDs will not be reused when a new one is built. > This is being done irrespective of the ipcmni mode. That's not what I said. Increment the sequence ID when the cursor wraps, not when there's been a deletion.