Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1396258ybl; Tue, 3 Dec 2019 06:34:49 -0800 (PST) X-Google-Smtp-Source: APXvYqzlBx5WZXyHUI4Yk5tste2pujTMUv2e4tqfTh3PJijdR07XQxoBfdH+Gkn/1BtcjNY2tYsB X-Received: by 2002:a9d:768b:: with SMTP id j11mr3402779otl.116.1575383689207; Tue, 03 Dec 2019 06:34:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575383689; cv=none; d=google.com; s=arc-20160816; b=txnDKR+ljR6CWhPmVOI5U2nYOLcRgrxp3p8t2k30/idBG/BazNsjweH6P3qSxctTc9 UJ/xjNmDzebiV/awNugH9Tr2h0Wv/0InFKYLGilFneDDHnLUoAb0tVC6DwM5CxeoxWEk poJm+Zj8v1go1e+15zQWgoDHTb9VrmtoBdp9kGE07vF9QlztAixkWrQAwmmCbJp4gs7i 7q75HwY4lvpYBtf4nwwBXE1ZIYv3r80HeBML5AcwRnjxYx/IFTZ/Pr9XgfHtP8kCwUza rEcAv1RgqfbIEkJ+bkjxhDnKPZdpWp8QoJjJ8uY3foBStaXmQSuMAV9CDT5Kk0jtjyIw 4Siw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr :dkim-signature; bh=RXSZcs/qVPDPyswC2jRGt//36h8Hc2BlXBaBEjUudjQ=; b=ByH6Y91bnPj4sXraaL+eBuOn5gfjt2XorvjGvtfshti3ZDrcvuVLc3qU2puCgKTJIp Cc2O1pJE3PyDEyH0Y+Mz9Aiomka5LunVEQjUK0TJx45N8mZ7ploI09TAdZBLYS3I5Y0c 4GlA515sSIQ0NvJbmb+FpGhzwiTummr7k9CYLYiemnn1bJnKko/mZfR0XO1rPJMTcrAW 0ckRdauUwcVBSci4LJJSslT2E62l/otPY304ebFCZCoayCxnPK486OEJz4f6yHgiVWvp 4AfGKQaH9aAongNcURUf5Ok5XDviwCLuixIXQcwnodDTNPfriAZd+5CS15YOFqOLyi9B oeXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=wCY14kfs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si1314155oia.165.2019.12.03.06.34.36; Tue, 03 Dec 2019 06:34:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=wCY14kfs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726214AbfLCOd7 (ORCPT + 99 others); Tue, 3 Dec 2019 09:33:59 -0500 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]:23797 "EHLO smtp-fw-33001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725848AbfLCOd7 (ORCPT ); Tue, 3 Dec 2019 09:33:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1575383639; x=1606919639; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=RXSZcs/qVPDPyswC2jRGt//36h8Hc2BlXBaBEjUudjQ=; b=wCY14kfszZN+5M1gGz+TNBSn7W9LeJon/wiBTFc11q8Lq9THCvjcc7oW Sc6DPB/6KJN0EHhr5PhhoNvA21EpjSePDgM6A9RTOr6W0mELeser6QsvB 1AnBz4aHiQZVkSQTM1CXlEaiyktC1obHotEMZ8c1lRmv9wW4PITwFhJoQ M=; IronPort-SDR: coc3S0BFg7Yzigp7n7nUbxLeudhPKgshlx19TdBKmZeiBGKBdRS0F5W3etCiCBhBBo4Uwe2x2V JWuoaX8mHwvw== X-IronPort-AV: E=Sophos;i="5.69,273,1571702400"; d="scan'208";a="12661880" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-2a-f14f4a47.us-west-2.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP; 03 Dec 2019 14:33:46 +0000 Received: from EX13MTAUEA001.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2a-f14f4a47.us-west-2.amazon.com (Postfix) with ESMTPS id D515EA17D7; Tue, 3 Dec 2019 14:33:45 +0000 (UTC) Received: from EX13D12UEA003.ant.amazon.com (10.43.61.184) by EX13MTAUEA001.ant.amazon.com (10.43.61.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 3 Dec 2019 14:33:45 +0000 Received: from EX13MTAUEA001.ant.amazon.com (10.43.61.82) by EX13D12UEA003.ant.amazon.com (10.43.61.184) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 3 Dec 2019 14:33:45 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.28.85.76) by mail-relay.amazon.com (10.43.61.243) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Tue, 3 Dec 2019 14:33:44 +0000 Subject: Re: [PATCH] xen/blkback: Avoid unmapping unmapped grant pages To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= , , CC: , , , SeongJae Park References: <20191126153605.27564-1-sjpark@amazon.com> <20191127091314.GK980@Air-de-Roger> From: Message-ID: <11ff29ea-ee0f-1dd1-a93e-84d1dd45418e@amazon.com> Date: Tue, 3 Dec 2019 15:33:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191127091314.GK980@Air-de-Roger> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27.11.19 10:13, Roger Pau Monné wrote: > On Tue, Nov 26, 2019 at 04:36:05PM +0100, SeongJae Park wrote: >> From: SeongJae Park >> >> 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: [] 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] [] gnttab_unmap_refs+0x34/0x40 >> [ 372.012759] [] xen_blkbk_unmap+0x83/0x150 [xen_blkback] >> ... >> [ 372.012802] [] 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") >> >> Signed-off-by: SeongJae Park >> Reviewed-by: David Woodhouse >> Reviewed-by: Maximilian Heyne >> Reviewed-by: Paul Durrant > Reviewed-by: Roger Pau Monné > > Thanks, Roger. May I ask some more comments? Thanks, SeongJae Park