From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752448AbaGVES5 (ORCPT ); Tue, 22 Jul 2014 00:18:57 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:33477 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752122AbaGVESz (ORCPT ); Tue, 22 Jul 2014 00:18:55 -0400 To: Christoph Hellwig Cc: James Bottomley , linux-scsi@vger.kernel.org, Jens Axboe , Bart Van Assche , Mike Christie , "Martin K. Petersen" , Robert Elliott , Webb Scales , linux-kernel@vger.kernel.org Subject: Re: [PATCH 07/14] scsi: convert host_busy to atomic_t From: "Martin K. Petersen" Organization: Oracle Corporation References: <1405678393-11497-1-git-send-email-hch@lst.de> <1405678393-11497-8-git-send-email-hch@lst.de> Date: Tue, 22 Jul 2014 00:18:19 -0400 In-Reply-To: <1405678393-11497-8-git-send-email-hch@lst.de> (Christoph Hellwig's message of "Fri, 18 Jul 2014 12:13:06 +0200") Message-ID: User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Source-IP: ucsinet22.oracle.com [156.151.31.94] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>>>> "Christoph" == Christoph Hellwig writes: Christoph> Avoid taking the host-wide host_lock to check the per-host Christoph> queue limit. Instead we do an atomic_inc_return early on to Christoph> grab our slot in the queue, and if nessecary decrement it Christoph> after finishing all checks. More nitpicking. In the two previous atomic conversion patches you kept %hu for the atomic_t. Here it's %d. +static ssize_t +sdev_show_device_busy(struct device *dev, struct device_attribute *attr, + char *buf) +{ + struct scsi_device *sdev = to_scsi_device(dev); + return snprintf(buf, 20, "%d\n", atomic_read(&sdev->device_busy)); +} +static DEVICE_ATTR(device_busy, S_IRUGO, sdev_show_device_busy, NULL); Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering