linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	david.vrabel@citrix.com, konrad.wilk@oracle.com
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/xen: Free bootmem in free_p2m_page() during early boot
Date: Wed, 07 Jan 2015 15:23:35 +0100	[thread overview]
Message-ID: <54AD4167.8020703@suse.com> (raw)
In-Reply-To: <1420639734-24808-1-git-send-email-boris.ostrovsky@oracle.com>

On 01/07/2015 03:08 PM, Boris Ostrovsky wrote:
> With recent changes in p2m we now have legitimate cases when
> p2m memory needs to be freed during early boot (i.e. before
> slab is initialized).
>
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

Reviewed-by: Juergen Gross <jgross@suse.com>

> ---
>   arch/x86/xen/p2m.c | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
> index edbc7a6..df8acb4 100644
> --- a/arch/x86/xen/p2m.c
> +++ b/arch/x86/xen/p2m.c
> @@ -167,10 +167,13 @@ static void * __ref alloc_p2m_page(void)
>   	return (void *)__get_free_page(GFP_KERNEL | __GFP_REPEAT);
>   }
>
> -/* Only to be called in case of a race for a page just allocated! */
>   static void free_p2m_page(void *p)
>   {
> -	BUG_ON(!slab_is_available());
> +	if (unlikely(!slab_is_available())) {
> +		free_bootmem((unsigned long)p, PAGE_SIZE);
> +		return;
> +	}
> +
>   	free_page((unsigned long)p);
>   }
>
>


  reply	other threads:[~2015-01-07 14:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-07 14:08 [PATCH] x86/xen: Free bootmem in free_p2m_page() during early boot Boris Ostrovsky
2015-01-07 14:23 ` Juergen Gross [this message]
2015-01-07 15:10 ` [Xen-devel] " David Vrabel
2015-01-07 15:18   ` Boris Ostrovsky

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=54AD4167.8020703@suse.com \
    --to=jgross@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.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;
as well as URLs for NNTP newsgroup(s).