From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: akash goel <akash.goels@gmail.com>,
Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org, linux-mm@kvack.org,
Hugh Dickins <hughd@google.com>,
Sourab Gupta <sourab.gupta@intel.com>,
"Goel, Akash" <akash.goel@intel.com>
Subject: Re: [Intel-gfx] [PATCH 1/2] shmem: Support for registration of Driver/file owner specific ops
Date: Thu, 20 Oct 2016 18:15:32 +0300 [thread overview]
Message-ID: <1476976532.3002.6.camel@linux.intel.com> (raw)
In-Reply-To: <CAK_0AV3KKVZOr6WRtFOox-WKQ0wR34ry-hnR=O7aMX8DhgcGhA@mail.gmail.com>
On ke, 2016-10-19 at 20:41 +0530, akash goel wrote:
> On Thu, Mar 24, 2016 at 5:41 PM, Joonas Lahtinen
> > <joonas.lahtinen@linux.intel.com> wrote:
> > On ke, 2016-03-23 at 11:39 +0530, akash.goel@intel.com wrote:
> > > @@ -34,11 +34,28 @@ struct shmem_sb_info {
> > > A A A A A A struct mempolicy *mpol;A A A A A /* default memory policy for mappings */
> > > A };
> > >
> > > +struct shmem_dev_info {
> > > +A A A A A void *dev_private_data;
> > > +A A A A A int (*dev_migratepage)(struct address_space *mapping,
> > > +A A A A A A A A A A A A A A A A A A A A A A A A A A A A struct page *newpage, struct page *page,
> > > +A A A A A A A A A A A A A A A A A A A A A A A A A A A A enum migrate_mode mode, void *dev_priv_data);
> >
> > One might want to have a separate shmem_dev_operations struct or
> > similar.
> >
> Sorry for the very late turnaround.
>
> Sorry couldn't get your point here. Are you suggesting to rename the
> structure to shmem_dev_operations ?
I'm pretty sure I was after putting migratepage function pointer in
shmem_dev_operations struct, but I think that can be done once there
are more functions.
s/dev_private_data/private_data/ and s/dev_priv_data/private_data/
might be in order, too. I should be obvious from context.
> > > +};
> > > +
> > > A static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
> > > A {
> > > A A A A A A return container_of(inode, struct shmem_inode_info, vfs_inode);
> > > A }
> > >
> > > +static inline int shmem_set_device_ops(struct address_space *mapping,
> > > +A A A A A A A A A A A A A A A A A A A A A A A A A A A A A struct shmem_dev_info *info)
> > > +{
This name could be shmem_set_dev_info, if there will be separate _ops
struct in future.
> > > +A A A A A if (mapping->private_data != NULL)
> > > +A A A A A A A A A A A A A return -EEXIST;
> > > +
> >
> > I did a quick random peek and most set functions are just void and
> > override existing data. I'd suggest the same.
> >
> > >
> > > +A A A A A mapping->private_data = info;
> >
> Fine will change the return type to void and remove the check.
>
> >
> > Also, doesn't this kinda steal the mapping->private_data, might that be
> > unexpected for the user? I notice currently it's not being touched at
> > all.
> >
> Sorry by User do you mean the shmem client who called shmem_file_setup() ?
> It seems clients are not expected to touch mapping->private_data and
> so shmemfs can safely use it.
If it's not used by others, should be fine. Not sure if WARN would be
in place, Chris?
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2016-10-20 15:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-23 6:09 [PATCH 1/2] shmem: Support for registration of Driver/file owner specific ops akash.goel
2016-03-23 6:09 ` [PATCH 2/2] drm/i915: Make pages of GFX allocations movable akash.goel
2016-03-23 7:58 ` Chris Wilson
2016-03-23 8:25 ` Goel, Akash
2016-03-24 8:13 ` Chris Wilson
2016-03-24 18:22 ` [PATCH v2 " akash.goel
2016-03-24 18:40 ` Chris Wilson
2016-04-04 11:27 ` [PATCH v3 " akash.goel
2016-03-24 12:11 ` [Intel-gfx] [PATCH 1/2] shmem: Support for registration of Driver/file owner specific ops Joonas Lahtinen
2016-10-19 15:11 ` akash goel
2016-10-20 15:15 ` Joonas Lahtinen [this message]
2016-11-04 12:48 ` [PATCH 1/2] shmem: Support for registration of driver/file " akash.goel
2016-11-04 12:48 ` [PATCH 2/2] drm/i915: Make GPU pages movable akash.goel
2016-11-04 13:37 ` Chris Wilson
2016-11-04 13:53 ` Goel, Akash
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=1476976532.3002.6.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=akash.goel@intel.com \
--cc=akash.goels@gmail.com \
--cc=chris@chris-wilson.co.uk \
--cc=hughd@google.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-mm@kvack.org \
--cc=sourab.gupta@intel.com \
/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).