Re: [PATCH] tmpfs: use ida to get inode number

From: Al Viro
Date: Wed Nov 20 2019 - 23:32:23 EST


On Wed, Nov 20, 2019 at 07:45:52AM -0800, Matthew Wilcox wrote:
> On Wed, Nov 20, 2019 at 10:23:18PM +0800, zhengbin wrote:
> > I have tried to change last_ino type to unsigned long, while this was
> > rejected, see details on https://patchwork.kernel.org/patch/11023915.
>
> Did you end up trying sbitmap?
>
> What I think is fundamentally wrong with this patch is that you've found a
> problem in get_next_ino() and decided to use a different scheme for this
> one filesystem, leaving every other filesystem which uses get_next_ino()
> facing the same problem.
>
> That could be acceptable if you explained why tmpfs is fundamentally
> different from all the other filesystems that use get_next_ino(), but
> you haven't (and I don't think there is such a difference. eg pipes,
> autofs and ipc mqueue could all have the same problem.

If you think that anyone is willing to pay one hell of a price on each
pipe(2)... Note that get_next_ino() is pretty careful about staying
within per-cpu stuff most of the time; it hits any cross-CPU traffic
only in 1/1024th of calls. This, AFAICS, dirties shared cachelines
on each call. And there's a plenty of pipe-heavy workloads, for obvious
reasons.