All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: jeremy@goop.org, xen-devel@lists.xensource.com, Ian.Campbell@citrix.com
Subject: [PATCH libxc] Remove set_max_grants in linux
Date: Tue, 11 Jan 2011 13:49:00 -0500	[thread overview]
Message-ID: <4D2CA61C.2060306@tycho.nsa.gov> (raw)
In-Reply-To: <20110111182137.GA29223@dumpdata.com>

On 01/11/2011 01:21 PM, Konrad Rzeszutek Wilk wrote:
> On Tue, Jan 11, 2011 at 01:18:09PM -0500, Daniel De Graaf wrote:
>> On 01/11/2011 12:51 PM, Konrad Rzeszutek Wilk wrote:
>>> On Tue, Jan 11, 2011 at 07:45:34AM -0500, Daniel De Graaf wrote:
>>>> On 01/10/2011 04:52 PM, Konrad Rzeszutek Wilk wrote:
>>>>>>  static long gntdev_ioctl(struct file *flip,
>>>>>>  			 unsigned int cmd, unsigned long arg)
>>>>>>  {
>>>>>> @@ -555,9 +538,6 @@ static long gntdev_ioctl(struct file *flip,
>>>>>>  	case IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR:
>>>>>>  		return gntdev_ioctl_get_offset_for_vaddr(priv, ptr);
>>>>>>  
>>>>>> -	case IOCTL_GNTDEV_SET_MAX_GRANTS:
>>>>>> -		return gntdev_ioctl_set_max_grants(priv, ptr);
>>>>>
>>>>> Would it make sense to return -EPNOTSUPPORTED? Or does it not really
>>>>> matter as nobody has been using this ioctl call?
>>>>
>>>> Does this produce a clearer error message than the default -ENOIOCTLCMD?
>>>> It's possible that some people use it, since it was exposed as an API.
>>>
>>> Looking at the Xen tools the user of this is:
>>> xc_gnttab_set_max_grants which would end up returning whatever the
>>> error is. I don't see any users of this in the Xen tools, thought there might
>>> be some in the XCP code. Lets stay with your ENOIOCTLCMD.
>>>
>>> However, I was wondering if you are going to submit a patch to the Xen
>>> tool stack so that it can utlize the SysFS interface to set the limits
>>> for that API call?
>>>
>>
>> No, because the semantics of what the limit is covering have changed. The
>> new limit is per-domain, and if there was any existing code that set the
>> limit, it would have been a per-open value and probably too low. I think
>> it was suggested that the call be removed from the Xen API; I can submit
>> a patch to do that, if you want.
> 
> Please do. Thank you.
>

I just removed the linux version, because I didn't want to prevent its use
in minios where it is needed to resize the array of grants.

------------------------------------------------------------------->8

The maximum number of grants is now constrained domain-wide in linux,
so set_max_grants should be a noop there. Previously, this constraint
was per-file-description.

diff -r 7b4c82f07281 tools/libxc/xc_gnttab.c
--- a/tools/libxc/xc_gnttab.c	Wed Jan 05 23:54:15 2011 +0000
+++ b/tools/libxc/xc_gnttab.c	Tue Jan 11 13:38:24 2011 -0500
@@ -184,6 +184,8 @@ int xc_gnttab_munmap(xc_gnttab *xcg,
 
 int xc_gnttab_set_max_grants(xc_gnttab *xcg, uint32_t count)
 {
+	if (!xcg->ops->u.gnttab.set_max_grants)
+		return 0;
 	return xcg->ops->u.gnttab.set_max_grants(xcg, xcg->ops_handle, count);
 }
 
diff -r 7b4c82f07281 tools/libxc/xc_linux_osdep.c
--- a/tools/libxc/xc_linux_osdep.c	Wed Jan 05 23:54:15 2011 +0000
+++ b/tools/libxc/xc_linux_osdep.c	Tue Jan 11 13:38:24 2011 -0500
@@ -627,19 +627,6 @@ static int linux_gnttab_munmap(xc_gnttab
     return 0;
 }
 
-static int linux_gnttab_set_max_grants(xc_gnttab *xcg, xc_osdep_handle h, uint32_t count)
-{
-    int fd = (int)h;
-    struct ioctl_gntdev_set_max_grants set_max;
-    int rc;
-
-    set_max.count = count;
-    if ( (rc = ioctl(fd, IOCTL_GNTDEV_SET_MAX_GRANTS, &set_max)) )
-        return rc;
-
-    return 0;
-}
-
 static struct xc_osdep_ops linux_gnttab_ops = {
     .open = &linux_gnttab_open,
     .close = &linux_gnttab_close,
@@ -649,7 +636,6 @@ static struct xc_osdep_ops linux_gnttab_
         .map_grant_refs = &linux_gnttab_map_grant_refs,
         .map_domain_grant_refs = &linux_gnttab_map_domain_grant_refs,
         .munmap = &linux_gnttab_munmap,
-        .set_max_grants = &linux_gnttab_set_max_grants,
     },
 };

  reply	other threads:[~2011-01-11 18:49 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-17  0:17 [PATCH v3] Userspace grant communication Daniel De Graaf
2010-12-17  0:17 ` [PATCH 1/7] xen-gntdev: Fix circular locking dependency Daniel De Graaf
2010-12-17  0:17 ` [PATCH 2/7] xen-gntdev: Change page limit to be global instead of per-open Daniel De Graaf
2011-01-10 21:52   ` Konrad Rzeszutek Wilk
2011-01-11 12:45     ` Daniel De Graaf
2011-01-11 17:51       ` Konrad Rzeszutek Wilk
2011-01-11 18:18         ` Daniel De Graaf
2011-01-11 18:21           ` Konrad Rzeszutek Wilk
2011-01-11 18:49             ` Daniel De Graaf [this message]
2011-01-12 17:17               ` [PATCH libxc] Remove set_max_grants in linux Ian Jackson
2011-01-12 17:57                 ` Daniel De Graaf
2011-01-13 12:09               ` Ian Jackson
2011-01-13 12:48                 ` Daniel De Graaf
2011-01-17 17:29               ` Ian Jackson
2010-12-17  0:17 ` [PATCH 3/7] xen-gntdev: Remove unneeded structures from grant_map tracking data Daniel De Graaf
2011-01-10 22:14   ` Konrad Rzeszutek Wilk
2011-01-11 13:02     ` Daniel De Graaf
2010-12-17  0:17 ` [PATCH 4/7] xen-gntdev: Use find_vma rather than iterating our vma list manually Daniel De Graaf
2010-12-17  0:17 ` [PATCH 5/7] xen-gntdev: Add reference counting to maps Daniel De Graaf
2010-12-17  0:49   ` Jeremy Fitzhardinge
2010-12-17 15:11     ` Daniel De Graaf
2010-12-17  0:51   ` Jeremy Fitzhardinge
2010-12-17 15:22   ` [PATCH 5/7 v2] " Daniel De Graaf
2011-01-10 22:28     ` Konrad Rzeszutek Wilk
2011-01-10 22:24   ` [PATCH 5/7] " Konrad Rzeszutek Wilk
2011-01-11 11:10     ` Stefano Stabellini
2011-01-11 17:46       ` Konrad Rzeszutek Wilk
2011-01-12 11:58         ` Stefano Stabellini
2010-12-17  0:17 ` [PATCH 6/7] xen-gntdev: Support mapping in HVM domains Daniel De Graaf
2010-12-17 15:22   ` [PATCH 6/7 v2] " Daniel De Graaf
2011-01-10 22:41   ` [PATCH 6/7] " Konrad Rzeszutek Wilk
2011-01-11 13:15     ` Daniel De Graaf
2011-01-11 14:52       ` Daniel De Graaf
2011-01-11 18:00         ` c/s 22402 ("86 hvm: Refuse to perform __hvm_copy() work in atomic context.") breaks HVM, race possible in other code - any ideas? Konrad Rzeszutek Wilk
2011-01-11 18:24           ` Daniel De Graaf
2010-12-17  0:17 ` [PATCH 7/7] xen-gntalloc: Userspace grant allocation driver Daniel De Graaf
2011-01-07 11:56 ` [PATCH v3] Userspace grant communication Stefano Stabellini
2011-01-14 15:18 ` Konrad Rzeszutek Wilk

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=4D2CA61C.2060306@tycho.nsa.gov \
    --to=dgdegra@tycho.nsa.gov \
    --cc=Ian.Campbell@citrix.com \
    --cc=jeremy@goop.org \
    --cc=konrad.wilk@oracle.com \
    --cc=xen-devel@lists.xensource.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.