From: Al Viro <viro@ZenIV.linux.org.uk>
To: Matthew Wilcox <willy@infradead.org>
Cc: Jerome Glisse <jglisse@redhat.com>,
Jeff Layton <jlayton@kernel.org>,
Dave Chinner <david@fromorbit.com>,
linux-mm@kvack.org, lsf-pc@lists.linux-foundation.org,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
linux-block@vger.kernel.org, Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>
Subject: Re: [LSF/MM] schedule suggestion
Date: Thu, 19 Apr 2018 21:39:53 +0100 [thread overview]
Message-ID: <20180419203953.GK30522@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20180419202513.GB14024@bombadil.infradead.org>
On Thu, Apr 19, 2018 at 01:25:13PM -0700, Matthew Wilcox wrote:
> On Thu, Apr 19, 2018 at 04:15:02PM -0400, Jerome Glisse wrote:
> > On Thu, Apr 19, 2018 at 12:56:37PM -0700, Matthew Wilcox wrote:
> > > > Well scratch that whole idea, i would need to add a new array to task
> > > > struct which make it a lot less appealing. Hence a better solution is
> > > > to instead have this as part of mm (well indirectly).
> > >
> > > It shouldn't be too bad to add a struct radix_tree to the fdtable.
> > >
> > > I'm sure we could just not support weird cases like sharing the fdtable
> > > without sharing the mm. Does anyone actually do that?
> >
> > Well like you pointed out what i really want is a 1:1 structure linking
> > a device struct an a mm_struct. Given that this need to be cleanup when
> > mm goes away hence tying this to mmu_notifier sounds like a better idea.
> >
> > I am thinking of adding a hashtable to mmu_notifier_mm using file id for
> > hash as this should be a good hash value for common cases. I only expect
> > few drivers to need that (GPU drivers, RDMA). Today GPU drivers do have
> > a hashtable inside their driver and they has on the mm struct pointer,
> > i believe hash mmu_notifier_mm using file id will be better.
>
> file descriptors are small positive integers ...
... except when there's a lot of them. Or when something uses dup2() in
interesting ways, but hey - we could "just not support" that, right?
> ideal for the radix tree.
> If you need to find your data based on the struct file address, then by
> all means a hashtable is the better data structure.
Perhaps it would be a good idea to describe whatever is being attempted?
FWIW, passing around descriptors is almost always a bloody bad idea. There
are very few things really associated with those and just about every time
I'd seen internal APIs that work in terms of those "small positive numbers"
they had been badly racy and required massive redesign to get something even
remotely sane.
next prev parent reply other threads:[~2018-04-19 20:39 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-18 21:19 [LSF/MM] schedule suggestion Jerome Glisse
2018-04-19 0:48 ` Dave Chinner
2018-04-19 1:55 ` Dave Chinner
2018-04-19 14:38 ` Jerome Glisse
2018-04-19 14:43 ` Matthew Wilcox
2018-04-19 16:30 ` Jerome Glisse
2018-04-19 16:58 ` Jeff Layton
2018-04-19 17:26 ` Jerome Glisse
2018-04-19 18:31 ` Jeff Layton
2018-04-19 19:31 ` Jerome Glisse
2018-04-19 19:56 ` Matthew Wilcox
2018-04-19 20:15 ` Jerome Glisse
2018-04-19 20:25 ` Matthew Wilcox
2018-04-19 20:39 ` Al Viro [this message]
2018-04-19 21:08 ` Jerome Glisse
2018-04-19 20:51 ` Al Viro
2018-04-19 20:33 ` Al Viro
2018-04-19 20:58 ` Jerome Glisse
2018-04-19 21:21 ` Al Viro
2018-04-19 21:47 ` Jerome Glisse
2018-04-19 22:13 ` Al Viro
2018-04-19 14:51 ` Chris Mason
2018-04-19 15:07 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180419203953.GK30522@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=david@fromorbit.com \
--cc=hannes@cmpxchg.org \
--cc=jglisse@redhat.com \
--cc=jlayton@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lsf-pc@lists.linux-foundation.org \
--cc=mhocko@kernel.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).