Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5661782imm; Tue, 12 Jun 2018 11:10:11 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLlwXj4pymQwmwpIIdrmGTtXaKw2aGpU3IG6r7E+6mjYAYtB7Ch3S4zqV7kP/WfAgr6JSh8 X-Received: by 2002:a63:6c03:: with SMTP id h3-v6mr1251116pgc.28.1528827011877; Tue, 12 Jun 2018 11:10:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528827011; cv=none; d=google.com; s=arc-20160816; b=HMdI2fDa9I899O3T43J253kDqp1zNxBHwzfFTmkNhOojnqzshjsiTaWJrCfHahK75V JNAZ92KKCfU0BVJmuY7bZiBsQsqMtbT9RLoIQL6k+ZmBi8DYGBX8UTEeGj3qvdjBw/pd VjaMz0ejpIEmL1WBBdMmjz/bR2bP+tBo3lD6dKkAJtfMWvipQhGvIjEvQPDjYj1feFcp veHsww4DnvZtdKyVFa1nky4uT/VBGFCABLj0BfVMpxVabo3+PMKVSfd0X02WQ2xWthfG Mcop/CyJP6FEEcakL56TTS7i3n8VCJhuM1f8ajXsT2cVBDEL+MO6RMPIT31DiPzNO5DE /UmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=EZmC6MgZPZnws5XA9fObuBumORt6Ugb7WdqStyrevaw=; b=DFVQlGbb7709K1deRq7jkH5mUO5+zYmY8JR0IKkDCquaSr3oV7xM+p06M1oQterVkx hWT1JrwLbltJtW4Yc3rcvoAfSQcrJzv46VLp6z5DJSCGf3oiih1mjA1KinxO4xixJ8Pf TZiv41x6NuofmmEkD9yqS+K9yD6N4Sb9l2MYbV7SNYjML7NZsIevZ/NzyyI8asRnCJsZ 5hnUWYfKOhYNaH8MbDgiMcB91fltV7jSZWg4caVm7xX8LkcT4D0qytUDabE5bzGa54Qt E0iaQCh8dJYOJX7krKsUGWY8CIWYEfB4Izd6J1Wx4dmuHdOWbzfJ4jnYK6E8zbdPzID7 Fpjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Jt4MSR0s; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 99-v6si651695plc.362.2018.06.12.11.09.57; Tue, 12 Jun 2018 11:10:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Jt4MSR0s; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934518AbeFLSJe (ORCPT + 99 others); Tue, 12 Jun 2018 14:09:34 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:52076 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934283AbeFLSIq (ORCPT ); Tue, 12 Jun 2018 14:08:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=EZmC6MgZPZnws5XA9fObuBumORt6Ugb7WdqStyrevaw=; b=Jt4MSR0sd9alITyAZAQN4+OTJ xl9l3pwvPcDT7o3Cw8UYHBYit8iKTWwXINfpKByhtyoiak5TfMJOxPtKRG0Nu7WFWb6JWhl/5BESl daYBMSHdXqFvMOTvJ+R8fliyb5v7z0gtA8x3jN4WpWboa9MLsjK7Rw923UJJuoCogDRsSJDfFK+hy AbBScdhK2G+gCzZzPMf+n/LCLfFyC5jEiPX8KT9Gta/+f6CD21AlgAFZl7ziapUO675vIkGs7jItV e70yZXwTvIJ9TDm464Fvb5n4LpsgAtE7L5dfcUB293Gaffv+5xdpQwzqzY1FzEWAfUZ9+2xypYycz 9U1MxdQAg==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fSnim-0001Sg-46; Tue, 12 Jun 2018 18:08:44 +0000 Date: Tue, 12 Jun 2018 11:08:43 -0700 From: Matthew Wilcox To: Bart Van Assche Cc: "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "kent.overstreet@gmail.com" , "linux1394-devel@lists.sourceforge.net" , "jgross@suse.com" , "axboe@kernel.dk" , "linux-scsi@vger.kernel.org" , "qla2xxx-upstream@qlogic.com" , "target-devel@vger.kernel.org" , "netdev@vger.kernel.org" Subject: Re: [PATCH 1/2] Convert target drivers to use sbitmap Message-ID: <20180612180843.GF19433@bombadil.infradead.org> References: <20180515160043.27044-1-willy@infradead.org> <20180515160043.27044-2-willy@infradead.org> <20180612161526.GE19433@bombadil.infradead.org> <0c93c72a3a339f3479f82de04223315671e07863.camel@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0c93c72a3a339f3479f82de04223315671e07863.camel@wdc.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 12, 2018 at 04:32:03PM +0000, Bart Van Assche wrote: > On Tue, 2018-06-12 at 09:15 -0700, Matthew Wilcox wrote: > > On Tue, Jun 12, 2018 at 03:22:42PM +0000, Bart Van Assche wrote: > > > Please introduce functions in the target core for allocating and freeing a tag > > > instead of spreading the knowledge of how to allocate and free tags over all > > > target drivers. > > > > I can't without doing an unreasonably large amount of work on drivers that > > I have no way to test. Some of the drivers have the se_cmd already; some > > of them don't. I'd be happy to introduce a common function for freeing > > a tag. > > Which target drivers are you referring to? If you are referring to the sbp driver: > I think that driver is dead and can be removed from the kernel tree. I even don't > know whether that driver ever has had any users other than the developer of that > driver. For example tcm_fc: tag = sbitmap_queue_get(&se_sess->sess_tag_pool, &cpu); if (tag < 0) goto busy; cmd = &((struct ft_cmd *)se_sess->sess_cmd_map)[tag]; or qla2xxx: tag = sbitmap_queue_get(&se_sess->sess_tag_pool, &cpu); if (tag < 0) return NULL; cmd = &((struct qla_tgt_cmd *)se_sess->sess_cmd_map)[tag]; The core doesn't know at what offset from the pointer to store the tag & cpu. Only the individual drivers know their cmd layout.