From mboxrd@z Thu Jan 1 00:00:00 1970 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=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 938DBC31E44 for ; Mon, 17 Jun 2019 06:46:37 +0000 (UTC) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 60E90218C9 for ; Mon, 17 Jun 2019 06:46:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=renesasgroup.onmicrosoft.com header.i=@renesasgroup.onmicrosoft.com header.b="GYqkBD4a" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 60E90218C9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 2A223A95; Mon, 17 Jun 2019 06:46:37 +0000 (UTC) Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 8BF25A70 for ; Mon, 17 Jun 2019 06:46:36 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from JPN01-TY1-obe.outbound.protection.outlook.com (mail-eopbgr1400098.outbound.protection.outlook.com [40.107.140.98]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id E9CB22C3 for ; Mon, 17 Jun 2019 06:46:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector2-renesasgroup-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lnGaHcQ8tF6UuYuj5w7KWm64uTDoc1O6aClv9W1hi9Q=; b=GYqkBD4aVWbK+xejBausvC/Mc8kVzAF4qUlgpHSA26b8N+wJlvQsYM44uM9NH7VWfhg7vhma4LgEMOl2THS+c0EdjtGa80qiDlnhp6k2XS/weLCng+/o4ui/2lDIWSrFsBWO/YJVS2vOwnKzlYhLHQkREMJdkMUiwd9Y5TlqmyY= Received: from OSBPR01MB3590.jpnprd01.prod.outlook.com (20.178.97.80) by OSBPR01MB2134.jpnprd01.prod.outlook.com (52.134.243.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1987.13; Mon, 17 Jun 2019 06:46:33 +0000 Received: from OSBPR01MB3590.jpnprd01.prod.outlook.com ([fe80::b1c2:125c:440d:e240]) by OSBPR01MB3590.jpnprd01.prod.outlook.com ([fe80::b1c2:125c:440d:e240%4]) with mapi id 15.20.1987.014; Mon, 17 Jun 2019 06:46:33 +0000 From: Yoshihiro Shimoda To: Christoph Hellwig Subject: RE: [RFC PATCH v6 5/5] mmc: queue: Use bigger segments if IOMMU can merge the segments Thread-Topic: [RFC PATCH v6 5/5] mmc: queue: Use bigger segments if IOMMU can merge the segments Thread-Index: AQHVIdGmGPEUTZUzykuLpLo4YRSl9aaawOiAgASqhHA= Date: Mon, 17 Jun 2019 06:46:33 +0000 Message-ID: References: <1560421215-10750-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> <1560421215-10750-6-git-send-email-yoshihiro.shimoda.uh@renesas.com> <20190614072459.GD8420@lst.de> In-Reply-To: <20190614072459.GD8420@lst.de> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=yoshihiro.shimoda.uh@renesas.com; x-originating-ip: [118.238.235.108] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d47081f2-7209-40ba-7da7-08d6f2ef8964 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:OSBPR01MB2134; x-ms-traffictypediagnostic: OSBPR01MB2134: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 0071BFA85B x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(136003)(39860400002)(366004)(346002)(376002)(396003)(199004)(189003)(256004)(478600001)(26005)(6506007)(14444005)(64756008)(66446008)(76176011)(316002)(476003)(68736007)(486006)(11346002)(446003)(8936002)(81156014)(81166006)(6246003)(86362001)(102836004)(8676002)(33656002)(25786009)(966005)(55016002)(3846002)(53936002)(9686003)(73956011)(6116002)(7696005)(76116006)(99286004)(66556008)(66476007)(186003)(66946007)(14454004)(6306002)(5660300002)(74316002)(66066001)(2906002)(305945005)(7736002)(54906003)(6916009)(71200400001)(71190400001)(4326008)(6436002)(52536014)(229853002)(135533001)(6606295002); DIR:OUT; SFP:1102; SCL:1; SRVR:OSBPR01MB2134; H:OSBPR01MB3590.jpnprd01.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: c15Jyn8qa+4ao8lDgmdZI5SSSsMwndeZ547K41xVtpgllyx1bKcmMES/jXtvx1ak6OH8gY7y09bvczaXvGzS9h3df+/fyxWdv8NXCVD//Ulz5NZ6POKh/oO2Fv/5QnT+x4+2Jc+dYtODFS3vk46C6WffyZLbN3MVXs+vLhgF1I1UG+U5vq0rzd9gbzBEgf7TbLYoA6T0pfL4dX3/UEe0ETV/qfq1rezX9ZOz6J+Nmf0cTm4T1LscHEofjX1/jQMffKIuQJij+1W5axp4p8U5G0VCrkImGzN9/hDQGpaw5atI/ExPZiTlpoJSwJNI4D9eyesDohDVjOffjk6McxwvExFNnjQFghBSE/4qN34XQjViTczvi+CkXvGTgtcs0ej05Hd8oAIWNYHRiNIGYL37ii6pk6MLN1NM5K8DPBJSyvk= MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d47081f2-7209-40ba-7da7-08d6f2ef8964 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jun 2019 06:46:33.3574 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: yoshihiro.shimoda.uh@renesas.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSBPR01MB2134 Cc: "axboe@kernel.dk" , "linux-renesas-soc@vger.kernel.org" , "ulf.hansson@linaro.org" , "linux-mmc@vger.kernel.org" , "linux-block@vger.kernel.org" , "wsa+renesas@sang-engineering.com" , "iommu@lists.linux-foundation.org" X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: iommu-bounces@lists.linux-foundation.org Errors-To: iommu-bounces@lists.linux-foundation.org Hi Christoph, > From: Christoph Hellwig, Sent: Friday, June 14, 2019 4:25 PM > > On Thu, Jun 13, 2019 at 07:20:15PM +0900, Yoshihiro Shimoda wrote: > > +static unsigned int mmc_get_max_segments(struct mmc_host *host) > > +{ > > + return host->can_merge ? BLK_MAX_SEGMENTS : host->max_segs; > > +} > > Note that BLK_MAX_SEGMENTS is really a little misnamed, it just > is a BLK_DEFAULT_SEGMENTS. I think you are better of picking your > own value here (even if 128 ends up ok) than reusing this somewhat > confusing constant. Thank you for your comments. I got it. I'll fix this. > > + /* > > + * Since blk_mq_alloc_tag_set() calls .init_request() of mmc_mq_ops, > > + * the host->can_merge should be set before to get max_segs from > > + * mmc_get_max_segments(). > > + */ > > + if (host->max_segs < BLK_MAX_SEGMENTS && > > + device_iommu_mapped(mmc_dev(host))) > > + host->can_merge = 1; > > + else > > + host->can_merge = 0; > > + > > can_merge seems a little too generic a name to me. Maybe can_iommu_merge? I'll fix the name. Also, only the device_iommu_mapped() condition wiil cause a problem on iommu=pt [1]. So, I'll add another condition here. [1] https://marc.info/?l=linux-mmc&m=156050608709643&w=2 Best regards, Yoshihiro Shimoda _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu