linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Wen Yang <wen.yang99@zte.com.cn>,
	boris.ostrovsky@oracle.com, sstabellini@kernel.org
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
	zhong.weidong@zte.com.cn, Julia Lawall <julia.lawall@lip6.fr>
Subject: Re: [PATCH v3] pvcalls-front: Avoid __get_free_pages(GFP_KERNEL) under spinlock
Date: Fri, 30 Nov 2018 15:13:04 +0100	[thread overview]
Message-ID: <3ae24ccf-d7ce-cfb8-8363-e9eb647bbffe@suse.com> (raw)
In-Reply-To: <20181130110107.31468-1-wen.yang99@zte.com.cn>

On 30/11/2018 12:01, Wen Yang wrote:
> The problem is that we call this with a spin lock held.
> The call tree is:
> pvcalls_front_accept() holds bedata->socket_lock.
>     -> create_active()
>         -> __get_free_pages() uses GFP_KERNEL
> 
> The create_active() function is only called from pvcalls_front_accept()
> with a spin_lock held, The allocation is not allowed to sleep and
> GFP_KERNEL is not sufficient.
> 
> This issue was detected by using the Coccinelle software.
> 
> v2: Add a function doing the allocations which is called
>     outside the lock and passing the allocated data to
>     create_active().
> v3: Use the matching deallocators i.e., free_page()
>     and free_pages(), respectively.
> 
> Suggested-by: Juergen Gross <jgross@suse.com>
> Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
> CC: Julia Lawall <julia.lawall@lip6.fr>
> CC: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> CC: Juergen Gross <jgross@suse.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: xen-devel@lists.xenproject.org
> CC: linux-kernel@vger.kernel.org
> ---

This patch is malformed. Please send it via an appropriate tool/mailer.

See e.g. Documentation/process/submitting-patches.rst or
Documentation/process/email-clients.rst in the Linux kernel source tree.


Juergen

  reply	other threads:[~2018-11-30 14:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-30 11:01 [PATCH v3] pvcalls-front: Avoid __get_free_pages(GFP_KERNEL) under spinlock Wen Yang
2018-11-30 14:13 ` Juergen Gross [this message]
2018-11-30 17:48 ` Boris Ostrovsky
2018-11-30 22:51   ` Stefano Stabellini

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=3ae24ccf-d7ce-cfb8-8363-e9eb647bbffe@suse.com \
    --to=jgross@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=julia.lawall@lip6.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sstabellini@kernel.org \
    --cc=wen.yang99@zte.com.cn \
    --cc=xen-devel@lists.xenproject.org \
    --cc=zhong.weidong@zte.com.cn \
    /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;
as well as URLs for NNTP newsgroup(s).