From: Jens Axboe <axboe@kernel.dk>
To: SeongJae Park <sjpark@amazon.com>,
konrad.wilk@oracle.com, roger.pau@citrix.com
Cc: xen-devel@lists.xenproject.org, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, SeongJae Park <sjpark@amazon.de>
Subject: Re: [PATCH] xen/blkback: Avoid unmapping unmapped grant pages
Date: Tue, 3 Dec 2019 14:03:46 -0700 [thread overview]
Message-ID: <43f9881b-4a88-47e9-c321-19033a2bc872@kernel.dk> (raw)
In-Reply-To: <20191126153605.27564-1-sjpark@amazon.com>
On 11/26/19 8:36 AM, SeongJae Park wrote:
> From: SeongJae Park <sjpark@amazon.de>
>
> For each I/O request, blkback first maps the foreign pages for the
> request to its local pages. If an allocation of a local page for the
> mapping fails, it should unmap every mapping already made for the
> request.
>
> However, blkback's handling mechanism for the allocation failure does
> not mark the remaining foreign pages as unmapped. Therefore, the unmap
> function merely tries to unmap every valid grant page for the request,
> including the pages not mapped due to the allocation failure. On a
> system that fails the allocation frequently, this problem leads to
> following kernel crash.
>
> [ 372.012538] BUG: unable to handle kernel NULL pointer dereference at 0000000000000001
> [ 372.012546] IP: [<ffffffff814071ac>] gnttab_unmap_refs.part.7+0x1c/0x40
> [ 372.012557] PGD 16f3e9067 PUD 16426e067 PMD 0
> [ 372.012562] Oops: 0002 [#1] SMP
> [ 372.012566] Modules linked in: act_police sch_ingress cls_u32
> ...
> [ 372.012746] Call Trace:
> [ 372.012752] [<ffffffff81407204>] gnttab_unmap_refs+0x34/0x40
> [ 372.012759] [<ffffffffa0335ae3>] xen_blkbk_unmap+0x83/0x150 [xen_blkback]
> ...
> [ 372.012802] [<ffffffffa0336c50>] dispatch_rw_block_io+0x970/0x980 [xen_blkback]
> ...
> Decompressing Linux... Parsing ELF... done.
> Booting the kernel.
> [ 0.000000] Initializing cgroup subsys cpuset
>
> This commit fixes this problem by marking the grant pages of the given
> request that didn't mapped due to the allocation failure as invalid.
>
> Fixes: c6cc142dac52 ("xen-blkback: use balloon pages for all mappings")
Queued up with Roger's reviewed-by.
--
Jens Axboe
prev parent reply other threads:[~2019-12-03 21:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-26 15:36 [PATCH] xen/blkback: Avoid unmapping unmapped grant pages SeongJae Park
2019-11-27 9:13 ` Roger Pau Monné
2019-12-03 14:33 ` sjpark
2019-12-03 21:03 ` Jens Axboe [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=43f9881b-4a88-47e9-c321-19033a2bc872@kernel.dk \
--to=axboe@kernel.dk \
--cc=konrad.wilk@oracle.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=roger.pau@citrix.com \
--cc=sjpark@amazon.com \
--cc=sjpark@amazon.de \
--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