All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: Saurabh Sengar <saurabh.truth@gmail.com>,
	jdike@addtoit.com, user-mode-linux-devel@lists.sourceforge.net,
	user-mode-linux-user@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] um: net: replace GFP_KERNEL with GFP_ATOMIC when spinlock is held
Date: Thu, 29 Oct 2015 09:47:37 +0100	[thread overview]
Message-ID: <5631DD29.60000@nod.at> (raw)
In-Reply-To: <1446103672-28864-1-git-send-email-saurabh.truth@gmail.com>

Am 29.10.2015 um 08:27 schrieb Saurabh Sengar:
> replace GFP_KERNEL with GFP_ATOMIC while spinlock is held,
> as code while holding a spinlock should be atomic.
> GFP_KERNEL may sleep and can cause deadlock,
> where as GFP_ATOMIC may fail but certainly avoids deadlock

As UML does not support SMP nor PREEMPT this is a non issue,
spinlocks are a NOP.
But for the sake of completeness you are right, the code needs
fixing.

> Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>
> ---
> v2: correcting the subject
> 
>  arch/um/drivers/net_kern.c | 31 +++++++++++++++++++++++--------
>  1 file changed, 23 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
> index f70dd54..7d4b709 100644
> --- a/arch/um/drivers/net_kern.c
> +++ b/arch/um/drivers/net_kern.c
> @@ -388,16 +388,22 @@ static const struct net_device_ops uml_netdev_ops = {
>  static int driver_registered;
>  
>  static void eth_configure(int n, void *init, char *mac,
> -			  struct transport *transport)
> +			  struct transport *transport, bool atomic)

Why do you need this atomic variable? Can't you just pass gfp_mask around?

Thanks,
//richard

      reply	other threads:[~2015-10-29  8:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29  7:27 [PATCH v2] um: net: replace GFP_KERNEL with GFP_ATOMIC when spinlock is held Saurabh Sengar
2015-10-29  8:47 ` Richard Weinberger [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=5631DD29.60000@nod.at \
    --to=richard@nod.at \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=saurabh.truth@gmail.com \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    --cc=user-mode-linux-user@lists.sourceforge.net \
    /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.