mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.cz>
To: Naveen Kumar Parna <pnaveenkos@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Synchronization mechanism between wait_for_completion_interruptible_timeout() & complete()
Date: Fri, 6 Mar 2015 09:48:07 +0100	[thread overview]
Message-ID: <20150306084807.GC22716@dhcp22.suse.cz> (raw)
In-Reply-To: <CAG0bkvKTFqbhHh=MRdLQnHJpEs4agiZX+05spdkK_zu5-W+rAA@mail.gmail.com>

On Fri 06-03-15 14:04:53, Naveen Kumar Parna wrote:
> Thanks Michal.
> 
> Now I am clearing x->done to zero before
> wait_for_completion_interruptible_timeout.

You shouldn't touch this internal thing. Why would you want that
anyway? If x->done > 0 then there has been something completed.

> On Thu, Mar 5, 2015 at 6:53 PM, Michal Hocko <mhocko@suse.cz> wrote:
> > On Wed 04-03-15 18:46:43, Naveen Kumar Parna wrote:
> >> Hello,
> >>
> >> I have a question regarding the synchronization mechanism between
> >> wait_for_completion_interruptible_timeout() & complete(). I used
> >> complete() API in the ISR Tx interrupt path and
> >> wait_for_completion_interruptible_timeout() in struct file_operations
> >> .write method.
> >>
> >> Let assume a scenario in which Tx interrupt occurred and ISR called
> >> complete() API before any process actually blocked at write method on
> >> wait_for_completion_interruptible_timeout().
> >>
> >> After a few milli seconds, a process called write() API. Does it gets
> >> blocked on wait_for_completion_interruptible_timeout() for completion
> >> of a specific task to be signaled from new Tx interrupt?
> >
> > No, see do_wait_for_common resp. complete and x->done handling.
> >
> > --
> > Michal Hocko
> > SUSE Labs

-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2015-03-06  8:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04 13:16 Naveen Kumar Parna
2015-03-05 13:23 ` Michal Hocko
2015-03-06  8:34   ` Naveen Kumar Parna
2015-03-06  8:48     ` Michal Hocko [this message]
2015-03-09  6:59       ` Naveen Kumar Parna

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=20150306084807.GC22716@dhcp22.suse.cz \
    --to=mhocko@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pnaveenkos@gmail.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

all inboxes | Powered by JetHome®