From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424404AbcFID3y (ORCPT ); Wed, 8 Jun 2016 23:29:54 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:22503 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161142AbcFID3s (ORCPT ); Wed, 8 Jun 2016 23:29:48 -0400 To: Long Li Cc: "Martin K. Petersen" , Tom Yan , "James E.J. Bottomley" , "linux-scsi\@vger.kernel.org" , "linux-kernel\@vger.kernel.org" Subject: Re: [PATCH] sd: remove redundant check for BLK_DEF_MAX_SECTORS From: "Martin K. Petersen" Organization: Oracle Corporation References: <1465012678-32547-1-git-send-email-longli@microsoft.com> Date: Wed, 08 Jun 2016 23:29:33 -0400 In-Reply-To: (Long Li's message of "Wed, 8 Jun 2016 04:22:21 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>>>> "Long" == Long Li writes: Long, Long> The problem I'm trying to solve is that, I want to have lower Long> layer driver to setup max_sectors bigger than Long> BLK_DEF_MAX_SECTORS. Capping at BLK_DEF_MAX_SECTORS unless a device has explicitly reported requirements is intentional. We have not had good experiences with making I/O requests too big in general. So BLK_DEF_MAX_SECTORS has deliberately been kept small. However, it was recently bumped to 1MB and change by default. Long> n Hyper-v, we use 2MB max transfer I/O size, in future version the Long> max transfer I/O size will increase to 8MB. But presumably you provide a BLOCK LIMITS VPD for your virtual targets? Long> The reason why I think it may not be necessary for sd.c to setup Long> max_sectors, it's because this value may have already been setup Long> twice before reaching the code in sd.c: 1. When this disk device Long> is first scanned, or re-scanned (in scsi_scan.c), where it Long> eventually calls __scsi_init_queue(), and use the max_sectors in Long> the scsi_host_template. 2. in slave_configure of Long> scsi_host_template, when the lower layer driver implements this Long> function in its template and it can change this value there. Those cause limits to be set for the controller. We won't know the device limits until we hit revalidate. blk_queue_max_hw_sectors() will also clamp the R/W max at BLK_DEF_MAX_SECTORS, though. -- Martin K. Petersen Oracle Linux Engineering