The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Maxim Levitsky <maximlevitsky@gmail.com>
To: Tejun Heo <tj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Alex Dubov <oakad@yahoo.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] memstick: add support for legacy memorysticks
Date: Mon, 24 Sep 2012 20:24:37 +0200	[thread overview]
Message-ID: <1348511077.618.19.camel@maxim-laptop> (raw)
In-Reply-To: <1348510768.618.16.camel@maxim-laptop>

On Mon, 2012-09-24 at 20:19 +0200, Maxim Levitsky wrote: 
> On Mon, 2012-09-24 at 11:05 -0700, Tejun Heo wrote: 
> > Hello,
> > 
> > On Mon, Sep 24, 2012 at 05:09:23PM +0200, Maxim Levitsky wrote:
> > > > Now that my exams done....
> > > > Can you spare me from using a workqueue?
> > 
> > I'd much prefer if you convert to workqueue.
> > 
> > > > The point is that using current model I wake the worker thread as much
> > > > as I want to, and I know that it will be woken once an will do all the
> > > > work till request queue is empty.
> > 
> > You can do exactly the same thing by scheduling the same work item
> > multiple times.  "Waking up" just becomes "scheduling the work item".
> I don't believe that will work this way.
> I will dig through the source, and see how to do that.
> 
> 
> 
> > > > With workqueues, it doesn't work this way. I have to pass the request as
> > > > a work item or something like that.
> > > > Any pointers?
> > 
> > No, there's no reason to change the structure of the code in any way.
> > Just use a work item as you would use a kthread.
> Except that if I schedule a same work item few times, these work items
> will be 'processed' in parallel, although there is just one work to do,
> work of pulling the requests from block queue until it has them, and
> dispatching them through my code.
> Or I can get a guarantee that work items wont be processed in parallel?
> Stiil, even with that only first work item will do the actual work,
> others will wake the workqueue for nothing, but I am ok with that.
Should have looked through the source. Understand now.
Just one quick question, should I create my own workqueue or use
schedule_work? if I use the later and my work function sleeps, will it
harmfully affect other users of this function?


-- 
Best regards,
        Maxim Levitsky




  reply	other threads:[~2012-09-24 18:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-19 13:19 Maxim Levitsky
2012-09-19 13:19 ` [PATCH] memstick: add support for legacy memorysticks Maxim Levitsky
2012-09-19 21:52   ` Andrew Morton
2012-09-20  4:05     ` Maxim Levitsky
2012-09-20 17:53       ` Tejun Heo
2012-09-24 14:59         ` Maxim Levitsky
2012-09-24 15:09           ` Maxim Levitsky
2012-09-24 18:05             ` Tejun Heo
2012-09-24 18:19               ` Maxim Levitsky
2012-09-24 18:24                 ` Maxim Levitsky [this message]
2012-09-24 18:28                   ` Tejun Heo
2012-09-24 18:25                 ` Tejun Heo
2012-09-20 17:49     ` Tejun Heo
  -- strict thread matches above, loose matches on Subject: below --
2013-07-08 14:11 [merged] memstick-add-support-for-legacy-memorysticks.patch removed from -mm tree Maxim Levitsky
2013-07-08 20:54 ` Driver for memestick standard cards Maxim Levitsky
2013-07-08 20:54   ` [PATCH] memstick: add support for legacy memorysticks Maxim Levitsky
2013-07-11  0:28     ` Maxim Levitsky
2013-07-11 21:22       ` Andrew Morton
2013-07-17 20:35     ` Andrew Morton

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=1348511077.618.19.camel@maxim-laptop \
    --to=maximlevitsky@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oakad@yahoo.com \
    --cc=tj@kernel.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