All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: akash goel <akash.goels@gmail.com>,
	Chris Wilson <chris@chris-wilson.co.uk>
Cc: "Goel, Akash" <akash.goel@intel.com>,
	linux-mm@kvack.org, intel-gfx@lists.freedesktop.org,
	Hugh Dickins <hughd@google.com>,
	Sourab Gupta <sourab.gupta@intel.com>
Subject: Re: [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 {
> > >       struct mempolicy *mpol;     /* default memory policy for mappings */
> > >  };
> > > 
> > > +struct shmem_dev_info {
> > > +     void *dev_private_data;
> > > +     int (*dev_migratepage)(struct address_space *mapping,
> > > +                            struct page *newpage, struct page *page,
> > > +                            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.

> > > +};
> > > +
> > >  static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
> > >  {
> > >       return container_of(inode, struct shmem_inode_info, vfs_inode);
> > >  }
> > > 
> > > +static inline int shmem_set_device_ops(struct address_space *mapping,
> > > +                             struct shmem_dev_info *info)
> > > +{

This name could be shmem_set_dev_info, if there will be separate _ops
struct in future.

> > > +     if (mapping->private_data != NULL)
> > > +             return -EEXIST;
> > > +
> > 
> > I did a quick random peek and most set functions are just void and
> > override existing data. I'd suggest the same.
> > 
> > > 
> > > +     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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

WARNING: multiple messages have this Message-ID (diff)
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>

  reply	other threads:[~2016-10-20 15:15 UTC|newest]

Thread overview: 30+ 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:22           ` akash.goel
2016-03-24 18:40           ` Chris Wilson
2016-04-04 11:27           ` [PATCH v3 " akash.goel
2016-04-04 11:27             ` akash.goel
2016-03-23  7:39 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] shmem: Support for registration of Driver/file owner specific ops Patchwork
2016-03-24 12:11 ` [PATCH 1/2] " Joonas Lahtinen
2016-03-24 12:11   ` [Intel-gfx] " Joonas Lahtinen
2016-10-19 15:11   ` akash goel
2016-10-19 15:11     ` [Intel-gfx] " akash goel
2016-10-20 15:15     ` Joonas Lahtinen [this message]
2016-10-20 15:15       ` Joonas Lahtinen
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:37             ` Chris Wilson
2016-11-04 13:53             ` Goel, Akash
2016-03-25  7:31 ` ✗ Fi.CI.BAT: warning for series starting with [1/2] shmem: Support for registration of Driver/file owner specific ops (rev2) Patchwork
2016-04-04 13:14 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] shmem: Support for registration of Driver/file owner specific ops (rev3) Patchwork
2016-11-04 13:31 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] shmem: Support for registration of driver/file owner specific ops (rev4) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2016-11-04 15:02 [PATCH 1/2] shmem: Support for registration of driver/file owner specific ops akash.goel
2016-11-10  5:36 ` Hugh Dickins
2016-11-10 16:22   ` Goel, Akash
2016-11-11 13:50     ` Chris Wilson
2016-11-11 13:50       ` Chris Wilson

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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.