From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752356AbcFGDmS (ORCPT ); Mon, 6 Jun 2016 23:42:18 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:23304 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751412AbcFGDmQ (ORCPT ); Mon, 6 Jun 2016 23:42:16 -0400 To: Long Li Cc: Tom Yan , "James E.J. Bottomley" , "Martin K. Petersen" , "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: Mon, 06 Jun 2016 23:42:05 -0400 In-Reply-To: (Long Li's message of "Sat, 4 Jun 2016 15:18:43 +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: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>>>> "Long" == Long Li writes: Long, Long> The reason is that, max_sectors already has value at this point, Long> the default value is SCSI_DEFAULT_MAX_SECTORS Long> (include/scsi/scsi_host.h). The lower layer host driver can change Long> this value in its template. The LLD sets max_hw_sectors which indicates the capabilities of the controller DMA hardware. Whereas the max_sectors limit is set by sd to either follow advise by the device or--if not provided--use the block layer default. max_sectors governs the size of READ/WRITE requests and do not reflect the capabilities of the DMA hardware. Long> I think the drivers care about this value have already set it. So Long> it's better not to change it again. If they want max_sectors to be Long> set by sd, they can use BLOCK LIMITS VPD to tell it to do so. Most drivers don't have the luxury of being able to generate VPDs for their attached target devices :) -- Martin K. Petersen Oracle Linux Engineering