Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4991365imm; Tue, 18 Sep 2018 02:32:28 -0700 (PDT) X-Google-Smtp-Source: ANB0VdankFwVCzY9yTQAv9pApPPzAhYWbLBV5c43smURN5Xdj5nyuRpdZdjLCGiC2/vVFHxkbJp0 X-Received: by 2002:a17:902:32f:: with SMTP id 44-v6mr28249170pld.15.1537263148786; Tue, 18 Sep 2018 02:32:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537263148; cv=none; d=google.com; s=arc-20160816; b=f9CtWN66pnLHVxldTuFr2+NVa4GodwdMOybYdvKvv7Yw9h7hG8TrzwdfAejZKarmpM MK3v+Tx0xHrlZ+VxQCooj/DRoHROXLX278WktknOUWtvuYw/zDHdbLslWHKadx/eSs8Q xjg8mFVTxoSnORSR8d+Keqyadbaf3HDs0rGNA3VwE0Y6luFVnwmXPyWqAyjL8wRJJoID IctyjAYJ3MJapLjAXGAEjN2GhQbomt4goGXYczfWolUp06i8NoLrWKckDkw5smH5PtXp yCU9gbusbzXTc07wmszvdd8dCOYgUimnQlSit2R58zN4TAG87gswDwA5g3c4OPy7DHHL oI/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=QBFu8bCfOoGEfCts6XCzJ8vaEzfk8LSYXdRYPM07IoE=; b=0R+vdVeOcmU2eEcOlZt1pZFXaZxc6zoeVIcuKe5/fBXpxMtJU5olKfTgPav+4d8J4u VfO3wzIEl5QDW/gFqhtcjNto4W+IxDEyAFYG4pX3vo4FOPgZ3fu7TiFPFF5z5MxpF8kP ZYKAcCb64o8r0bhJXxgwyPORNfa3hawTMkhwS9QDByXl5bOYaSp7sjJ+jg1mNdoLFCIW LjrLy9kfSRRCVzawMt0cuxzNU7vA4D/c4mtrN4im94w88qw5CFboQAe0fMjxjG+Tn4nB KiI5j0KUB9/2KYuq4HSevF1+5uvjerKuL4HMJntqKcuFO9+IKz3tWM1Si8wvbIalFaWz RuLw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u5-v6si17995760pgc.459.2018.09.18.02.32.11; Tue, 18 Sep 2018 02:32:28 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729501AbeIRPDt (ORCPT + 99 others); Tue, 18 Sep 2018 11:03:49 -0400 Received: from mx2.suse.de ([195.135.220.15]:54202 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726768AbeIRPDt (ORCPT ); Tue, 18 Sep 2018 11:03:49 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 1A1FEB024; Tue, 18 Sep 2018 09:32:02 +0000 (UTC) From: Juergen Gross To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org Cc: boris.ostrovsky@oracle.com, Juergen Gross Subject: [PATCH] xen: issue warning message when out of grant maptrack entries Date: Tue, 18 Sep 2018 11:32:00 +0200 Message-Id: <20180918093200.17499-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When a driver domain (e.g. dom0) is running out of maptrack entries it can't map any more foreign domain pages. Instead of silently stalling the affected domUs issue a rate limited warning in this case in order to make it easier to detect that situation. Signed-off-by: Juergen Gross --- drivers/xen/grant-table.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c index 7bafa703a992..09f6ff8c1957 100644 --- a/drivers/xen/grant-table.c +++ b/drivers/xen/grant-table.c @@ -1040,18 +1040,31 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, return ret; for (i = 0; i < count; i++) { - /* Retry eagain maps */ - if (map_ops[i].status == GNTST_eagain) - gnttab_retry_eagain_gop(GNTTABOP_map_grant_ref, map_ops + i, - &map_ops[i].status, __func__); - - if (map_ops[i].status == GNTST_okay) { + switch (map_ops[i].status) { + case GNTST_okay: + { struct xen_page_foreign *foreign; SetPageForeign(pages[i]); foreign = xen_page_foreign(pages[i]); foreign->domid = map_ops[i].dom; foreign->gref = map_ops[i].ref; + break; + } + + case GNTST_no_device_space: + pr_warn_ratelimited("maptrack limit reached, can't map all guest pages\n"); + break; + + case GNTST_eagain: + /* Retry eagain maps */ + gnttab_retry_eagain_gop(GNTTABOP_map_grant_ref, + map_ops + i, + &map_ops[i].status, __func__); + break; + + default: + break; } } -- 2.16.4