Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C8EFC433DB for ; Thu, 14 Jan 2021 07:26:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B1721207AE for ; Thu, 14 Jan 2021 07:26:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726127AbhANH0e (ORCPT ); Thu, 14 Jan 2021 02:26:34 -0500 Received: from mx2.suse.de ([195.135.220.15]:40066 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726055AbhANH0e (ORCPT ); Thu, 14 Jan 2021 02:26:34 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id DD8CDABD6; Thu, 14 Jan 2021 07:25:52 +0000 (UTC) Subject: Re: [PATCH v13 41/45] sg: track lowest inactive and await indexes To: Douglas Gilbert , linux-scsi@vger.kernel.org Cc: martin.petersen@oracle.com, jejb@linux.vnet.ibm.com, kashyap.desai@broadcom.com References: <20210113224526.861000-1-dgilbert@interlog.com> <20210113224526.861000-42-dgilbert@interlog.com> From: Hannes Reinecke Message-ID: <50eee49d-8a88-3692-af3a-cbede1b77737@suse.de> Date: Thu, 14 Jan 2021 08:25:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20210113224526.861000-42-dgilbert@interlog.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org On 1/13/21 11:45 PM, Douglas Gilbert wrote: > Use two integers in the sg_fd structure to track recent and lowest > xarray indexes that have become inactive or await a foreground > receive. This is used to shorten the number of xarray iterations > required prior to a match when queue (IO) depths are large, say > 128. > > Replace the req_cnt atomic in struct sg_fd with the inactives > atomic. With large queues cycles were wasted checking the request > xarray for any inactives when there were none to be found. > > Rename the sg_rq_state_chg_*() functions to sg_rq_chg_state_*() > since too many things start with "sg_rq_state". Also the new > function names emphasize the change part a little more. > > Signed-off-by: Douglas Gilbert > --- > drivers/scsi/sg.c | 304 ++++++++++++++++++++++++++-------------------- > 1 file changed, 175 insertions(+), 129 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer