Re: [PATCH 1/2] open: add close_range()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
- Subject: Re: [PATCH 1/2] open: add close_range()
- From: Christian Brauner <christian@xxxxxxxxxx>
- Date: Wed, 22 May 2019 10:12:11 +0200
- Cc: David Howells <dhowells@xxxxxxxxxx>, Al Viro <viro@xxxxxxxxxxxxxxxxxx>, Linux List Kernel Mailing <linux-kernel@xxxxxxxxxxxxxxx>, linux-fsdevel <linux-fsdevel@xxxxxxxxxxxxxxx>, Linux API <linux-api@xxxxxxxxxxxxxxx>, Jann Horn <jannh@xxxxxxxxxx>, Florian Weimer <fweimer@xxxxxxxxxx>, Oleg Nesterov <oleg@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Shuah Khan <shuah@xxxxxxxxxx>, Todd Kjos <tkjos@xxxxxxxxxxx>, "Dmitry V. Levin" <ldv@xxxxxxxxxxxx>, Miklos Szeredi <miklos@xxxxxxxxxx>, alpha <linux-alpha@xxxxxxxxxxxxxxx>, Linux ARM <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, linux-ia64@xxxxxxxxxxxxxxx, linux-m68k <linux-m68k@xxxxxxxxxxxxxxx>, linux-mips@xxxxxxxxxxxxxxx, Parisc List <linux-parisc@xxxxxxxxxxxxxxx>, linuxppc-dev <linuxppc-dev@xxxxxxxxxxxxxxxx>, linux-s390 <linux-s390@xxxxxxxxxxxxxxx>, Linux-sh list <linux-sh@xxxxxxxxxxxxxxx>, sparclinux <sparclinux@xxxxxxxxxxxxxxx>, linux-xtensa@xxxxxxxxxxxxxxxx, linux-arch <linux-arch@xxxxxxxxxxxxxxx>, "open list:KERNEL SELFTEST FRAMEWORK" <linux-kselftest@xxxxxxxxxxxxxxx>, "the arch/x86 maintainers" <x86@xxxxxxxxxx>
- In-reply-to: <CAHk-=wgtHm4t71oKbykE=awiVv2H2wCy8yH0L_FsyhHQ5OSO+Q@mail.gmail.com>
- References: <20190521150006.GJ17978@ZenIV.linux.org.uk> <20190521113448.20654-1-christian@brauner.io> <28114.1558456227@warthog.procyon.org.uk> <20190521164141.rbehqnghiej3gfua@brauner.io> <CAHk-=wgtHm4t71oKbykE=awiVv2H2wCy8yH0L_FsyhHQ5OSO+Q@mail.gmail.com>
On Tue, May 21, 2019 at 10:23 PM Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> On Tue, May 21, 2019 at 9:41 AM Christian Brauner <christian@xxxxxxxxxx> wrote:
> >
> > Yeah, you mentioned this before. I do like being able to specify an
> > upper bound to have the ability to place fds strategically after said
> > upper bound.
>
> I suspect that's the case.
>
> And if somebody really wants to just close everything and uses a large
> upper bound, we can - if we really want to - just compare the upper
> bound to the file table size, and do an optimized case for that. We do
> that upper bound comparison anyway to limit the size of the walk, so
> *if* it's a big deal, that case could then do the whole "shrink
> fdtable" case too.
Makes sense.
>
> But I don't believe it's worth optimizing for unless somebody really
> has a load where that is shown to be a big deal. Just do the silly
> and simple loop, and add a cond_resched() in the loop, like
> close_files() does for the "we have a _lot_ of files open" case.
Ok. I will resend a v1 later with the cond_resched() logic you and Al
suggested added.
Thanks!
Christian
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]