mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: mihailov ivan <mihailov.iaa@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] change lock model in aio_put_req
Date: Thu, 07 Jun 2012 15:52:11 -0400	[thread overview]
Message-ID: <x4962b2aoic.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <CA+Z7AcZ=Qf7d6iCziTsi=AH+CjWkhkWeGzhOAY0VqVX3Ni_fXw@mail.gmail.com> (mihailov ivan's message of "Thu, 7 Jun 2012 22:41:22 +0300")

mihailov ivan <mihailov.iaa@gmail.com> writes:

> 2012/6/7 Jeff Moyer <jmoyer@redhat.com>:
>> mihailov ivan <mihailov.iaa@gmail.com> writes:
>>
>>> Why used spin_lock/unlock_irq instead of
>>> spin_lock_irqsave/spin_unlock_irqrestore?
>>
>> Because the function is never called from interrupt context.
>>
>>> __aio_put_req it's interrupt safe call but why aio_put_req not?
>>
>> __aio_put_req is called with the ctx lock already taken.  This (the __
>> routine being called with the lock held) is a fairly common convention
>> in the kernel.
>>
>> Nack.  Your patch doesn't fix anything.
>
> Yes, my patch doesn't fix anything but it's allows this call inside of
> interrupt context.

But it doesn't need to be called from interrupt context, so there's
really no point in changing it.

> And curios why it can't be possible inside of interrupt context?

If ever a caller needs the functionality, we can change it.

> From side - never changed, only we will can execute this call in
> interrupt context.  I understood what is works as designed but don't
> understood why we can't imporve this call, it's 'fairly convention in
> the kernel'?

Changing this is simply not an improvement, it's just a change with no
benefit.  There's really no point.

Now, are you going to tell me that you want to call this function from
interrupt context in some third party driver?  What's the real
motivation for this patch?

Cheers,
Jeff

  reply	other threads:[~2012-06-07 19:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-06 22:46 mihailov ivan
2012-06-07 14:31 ` Jeff Moyer
2012-06-07 19:41   ` mihailov ivan
2012-06-07 19:52     ` Jeff Moyer [this message]
2012-06-07 20:30       ` mihailov ivan

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=x4962b2aoic.fsf@segfault.boston.devel.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mihailov.iaa@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®