From patchwork Mon Aug 6 11:33:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 10556843 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 30DB113BB for ; Mon, 6 Aug 2018 11:34:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FA2829251 for ; Mon, 6 Aug 2018 11:34:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 13C3129305; Mon, 6 Aug 2018 11:34:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCED129251 for ; Mon, 6 Aug 2018 11:34:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727340AbeHFNnB (ORCPT ); Mon, 6 Aug 2018 09:43:01 -0400 Received: from mx2.suse.de ([195.135.220.15]:33720 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728417AbeHFNnA (ORCPT ); Mon, 6 Aug 2018 09:43:00 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D8009AE83; Mon, 6 Aug 2018 11:34:18 +0000 (UTC) From: Juergen Gross To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, linux-block@vger.kernel.org Cc: konrad.wilk@oracle.com, roger.pau@citrix.com, axboe@kernel.dk, boris.ostrovsky@oracle.com, Juergen Gross Subject: [PATCH 0/4] xen/blk: persistent grant rework Date: Mon, 6 Aug 2018 13:33:58 +0200 Message-Id: <20180806113403.24728-1-jgross@suse.com> X-Mailer: git-send-email 2.13.7 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Persistent grants are used in the Xen's blkfront/blkback drivers to avoid mapping/unmapping of I/O buffers in the backend for each I/O. While this speeds up processing quite a bit there are problems related to persistent grants in some configurations: domains with multiple block devices making use of persistent grants might suffer from a lack of grants if each of the block devices experienced a high I/O load at some time. This is due to the number of persistent grants per device only to be limited by a rather high maximum value, but never being released even in case of longer times without any I/O. This series modifies xen-blkback to unmap any domU page mapped via a persistent grant after a timeout (default: 60 seconds). The timeout is set to its default value again when a persistent grant has been used for an I/O. xen-blkfront is modified to scan every 10 seconds for persistent grants not in use by blkback any more and to remove such grants. The last 2 patches are small cleanups of blkfront and blkback drivers. Juergen Gross (4): xen/blkback: don't keep persistent grants too long xen/blkfront: cleanup stale persistent grants xen/blkfront: reorder tests in xlblk_init() xen/blkback: remove unused pers_gnts_lock from struct xen_blkif_ring drivers/block/xen-blkback/blkback.c | 77 +++++++++++++++--------- drivers/block/xen-blkback/common.h | 2 +- drivers/block/xen-blkfront.c | 115 ++++++++++++++++++++++++++++++++---- 3 files changed, 153 insertions(+), 41 deletions(-)