From patchwork Wed Jun 26 01:47:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 11016731 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 6CEDA924 for ; Wed, 26 Jun 2019 01:48:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5ECAD2859F for ; Wed, 26 Jun 2019 01:48:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 52C192862A; Wed, 26 Jun 2019 01:48:04 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 08378285A9 for ; Wed, 26 Jun 2019 01:48:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726357AbfFZBsD (ORCPT ); Tue, 25 Jun 2019 21:48:03 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:15693 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726037AbfFZBsD (ORCPT ); Tue, 25 Jun 2019 21:48:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1561513683; x=1593049683; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=xUw+MD3VlgufJngshYeX3WtdTL/x5T203xypje7oPKg=; b=X2O9CYMOuC56DzBEeWZBxWn4I+uBLXUTVtviHySev1oA1IqLE5YEy1sv /mGhqP0TxmXgy6Kh2by8ROD39W1r1WSw7KEuJYqbz1vM3W5sN91iD/SmS eSdEOvghBdh62R+BFcIfu7i02BnxPTQQylGrhYjwJPwYELP6AQIaGPLtW LaKC94dpMTze1X8dkGTZ/GkNL3NLxyoFk8l8ymryjZ8Wsq4vYktysDoE7 HmNWyNcK+RGp76GHAmxzALID6krYbPMR+XEPjMB7eGQahdXOUuiSJNHTX ijTWP9DhOn8CVp1kVvQXriSqBsSfqNukl0l51Ytmsut7HYUaWSBBw9WHv Q==; X-IronPort-AV: E=Sophos;i="5.63,418,1557158400"; d="scan'208";a="116422519" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 26 Jun 2019 09:48:02 +0800 IronPort-SDR: wrWlNOZ0loVmDPtZ3zVa/5p+3oYdKNBLQmJYC8Plk+9HtCF+JDe1glE1alyB0d7Fc8n1w7behf mD8vCaEzRgDaFjh9cPi0ajwrWJp/HTuDskdxRe+frtoJ1uzSNP7rTx5ijpfFCzbIqqr+j5k83m IhGRbodssFyGTgIGVaQB9+Xz1o0c8rQGUS52vq2U33V2va80ynxOK/8rUcydjAknzSCKsdPS1H 2X7KSssJAaOiQVrmsma3Fzo3GQs6bQz8W2yMvXs1z/qdG3nyTg7sLpL65EWP31WHIHdU1DB+Um SpCdZoWHkrCGB2rC3+0t5KNV Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 25 Jun 2019 18:47:11 -0700 IronPort-SDR: Rw8upLbn9kjvv/LaCSkqyBwahxbcThGYFaOun0OwhcHuVU64W87UzuzZrBsjGk2wryuikLLDgC T8rZQRrrmkZV5OpiECb4ylHQCOyGU2bsRzQb93LyGELVJtz0xpo3mn91U7CEQpp9FYTW5YJckl LOe3nmQm4L0xt0BNMyUZG79A3ng/StDsLHAV59I81tdvLLq0jngIesTj+5eDpQYYCMvrzb5NfW QnWdTMajC74Esnfu6av+aFu/Mf42PzfNjXxWaBd6q4W544Q9KDLb7zIP3frST4+R6hcElr+hvg Mi8= Received: from washi.fujisawa.hgst.com ([10.149.53.254]) by uls-op-cesaip02.wdc.com with ESMTP; 25 Jun 2019 18:48:00 -0700 From: Damien Le Moal To: linux-scsi@vger.kernel.org, "Martin K . Petersen" , linux-block@vger.kernel.org, Jens Axboe Cc: Christoph Hellwig , Bart Van Assche Subject: [PATCH V2 0/3] Fix zone revalidation memory allocation failures Date: Wed, 26 Jun 2019 10:47:56 +0900 Message-Id: <20190626014759.15285-1-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This series addresses a reccuring problem with zone revalidation failures observed during extensive testing with memory constrained system and device hot-plugging. The problem source is failure to allocate large memory areas with alloc_pages() or kmalloc() in blk_revalidate_disk_zones() to store the disk array of zones (struct blk_zone) or in sd_zbc_report_zones() for the report zones command reply buffer. The solution proposed here is to: 1) limit the number of zones to be reported with a single report zones command execution, and 2) Use vmalloc to allocate large-ish arrays and buffers in place of alloc_pages() and kmalloc(). With these changes, tests do not show any zone revalidation failures while not impacting the time taken for a disk initial zone inspection during device scan. Changes from V1: * Added call to invalidate_kernel_vmap_range() for vmalloc-ed buffers in patch 1. * Fixed patch 2 compilation error with Sparc64 (kbuild robot) Damien Le Moal (3): block: Allow mapping of vmalloc-ed buffers sd_zbc: Fix report zones buffer allocation block: Limit zone array allocation size block/bio.c | 12 ++++++- block/blk-zoned.c | 29 +++++++-------- drivers/scsi/sd_zbc.c | 80 +++++++++++++++++++++++++++++++----------- include/linux/blkdev.h | 5 +++ 4 files changed, 89 insertions(+), 37 deletions(-)