All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
To: Koushik Chakravarty <koushik.chakravarty@citrix.com>
Cc: "'xen-devel@lists.xensource.com'" <xen-devel@lists.xensource.com>,
	Euan Harris <euan.harris@citrix.com>
Subject: Re: tools/libxl - Async Task Cancellation Query [and 1 more messages]
Date: Tue, 14 Apr 2015 11:02:17 +0100	[thread overview]
Message-ID: <21804.58793.408184.86239@mariner.uk.xensource.com> (raw)
In-Reply-To: <E638B0CB6CFBD44183ABE72A42E666268B15A9@SINPEX01CL03.citrite.net>, <E638B0CB6CFBD44183ABE72A42E666268B5840@SINPEX01CL03.citrite.net>

Koushik Chakravarty writes ("RE: tools/libxl - Async Task Cancellation Query"):
> When you say - " That would require the caller to preserve the ao_how which seems awkward to me " - whom do you refer as the caller? 

By the caller I mean the program outside libxl which is calling libxl.

> >From what I picked up, the libxl_ao_cancel() API is passed with the ao_how. The libxl_ao_cancel then looks into the ctx->aos_inprogress list to find the ao that matches the ao_how.

Yes.

> So what I was suggesting was that if the ao_how was allotted an 'id' from the original libxl api call (done using a counter increment from the global libxl ctx with a lock held), and the same id was saved in the ao entry in ctx->aos_inprogress, then searching/matching them in libxl_ao_cancel() would have been a little faster. 

Sorry, I had misunderstood.  I thought you were proposing some kind of
arrangement where libxl would be able to look up the relevant ao in
O(1).  That would require either the lifetime of these ids to be
controlled.

But now I understand that you're just proposing a pure id which still
requires a search.  I don't think the performance benefit is really
worthwhile for the extra complexity.

This is particularly true given that currently the ao_how is const.
So the caller might have defined it as `static const' and put it in
the text segment.  Changing the API to make this parameter non-const
sometimes, in a backward compatible way, would be a bit complicated.

But thanks anyway for your suggestion.

Ian.

      reply	other threads:[~2015-04-14 10:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-08  8:37 tools/libxl - Async Task Cancellation Query Koushik Chakravarty
2015-04-08 11:21 ` Ian Jackson
2015-04-08 12:13   ` Koushik Chakravarty
2015-04-14  9:42     ` Koushik Chakravarty
2015-04-14 10:02       ` Ian Jackson [this message]

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=21804.58793.408184.86239@mariner.uk.xensource.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=euan.harris@citrix.com \
    --cc=koushik.chakravarty@citrix.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.