Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751963AbdH3CSB (ORCPT ); Tue, 29 Aug 2017 22:18:01 -0400 Received: from mail-cys01nam02on0095.outbound.protection.outlook.com ([104.47.37.95]:45342 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751514AbdH3CR7 (ORCPT ); Tue, 29 Aug 2017 22:17:59 -0400 From: Long Li To: Christoph Hellwig CC: Steve French , "linux-cifs@vger.kernel.org" , "samba-technical@lists.samba.org" , "linux-kernel@vger.kernel.org" Subject: RE: [[PATCH v1] 15/37] [CIFS] SMBD: Post a SMBD data transfer message with data payload Thread-Topic: [[PATCH v1] 15/37] [CIFS] SMBD: Post a SMBD data transfer message with data payload Thread-Index: AQHTC8uo0yH3M5t9IEWYLpdu5uSbkKKCJOWAgBour4A= Date: Wed, 30 Aug 2017 02:17:56 +0000 Message-ID: References: <1501704648-20159-1-git-send-email-longli@exchange.microsoft.com> <1501704648-20159-16-git-send-email-longli@exchange.microsoft.com> <20170813102345.GG17287@infradead.org> In-Reply-To: <20170813102345.GG17287@infradead.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Ref=https://api.informationprotection.azure.com/api/72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=longli@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2017-08-29T19:17:55.5165603-07:00; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic; Sensitivity=General x-originating-ip: [2001:4898:80e8:c::735] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MWHPR21MB0766;6:50qSJPr3Ul/vqIJJqF/ywk+LNogUSn1fWGy6N6GCijn2QnwLdkMq0EuYVFMIsKPyDeFbRLsJNAnAONSiZPnQnCpIeM7dW+PSD0VzFYDX/WZ6mVy8iN9lF6Zi0BbbEkQHvvDE7Hb8GkBHPOf9aqCWRJB2xpfWc5gFdagxTc+kEf5pdxPPZ6gAZud6EBULVqrIqPQxnbGQQ2x/5DCkQ2FTv7EKj8JeGKcuREPpmP21CaoRxHsruTjYyrzYCIcftJvHCFix/v7/Grrv+VkNU7aA4WC8J2iRQEQT520Rci1qETKBxmQIkMDMlriFgoF9NxzD6sZTqgGbI1fHjEyFtCQpaw==;5:Rshfr2HJF/tM9hPkSmhy/5zTWw6cJjHZoSimVsv8RuAfFBZZfw2ZNGiPQ8Wtw7HqGMZ4W5r/N3GE8pfeMRUgeqqlwOahIFI6zj489HjGmtLgDbEmCCoG60vdmPvZGECMrPrVhDbMplEMJLLJGDY/EQ==;24:zbiA9CbxNNi/z7I2uZpEBX2ad+UFT2s99D/bCLZ9AZ9CDFTvDrGcPJM2S8o+l6lRIwwYgVEPs1OzFy1v++kzBOJ+Pi6Z6Ud7fXgealE/Ddc=;7:Vfc+WDo69isjZNpJeTYYbelLKBoqHLqTXSCVOxneTgU4Rj20R+F4xUjVrsiqQeFD2SMlPxrpXrr82HE+ajnd7Zz8G0ZnlgUgtyQYFnG0CeTLUKwH2yMMzSdgHLb21ywFpBHKMk6WrebT+/+WF9Jyln6lpJrNLqPTUORDJnerbCSErK2jE/8udjwJTb9l4tVZkKVvin4SundK5LtibkO9VqVAqoeMPU0Fny0fT4QDHPU= x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 90a5b112-5ae7-4dfa-c425-08d4ef4d5452 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:MWHPR21MB0766; x-ms-traffictypediagnostic: MWHPR21MB0766: authentication-results: spf=none (sender IP is ) smtp.mailfrom=longli@microsoft.com; x-exchange-antispam-report-test: UriScan:(89211679590171)(9452136761055); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(61425038)(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(6055026)(61426038)(61427038)(6041248)(20161123564025)(20161123562025)(20161123560025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:MWHPR21MB0766;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:MWHPR21MB0766; x-forefront-prvs: 041517DFAB x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(47760400005)(199003)(377454003)(13464003)(189002)(97736004)(106356001)(55016002)(478600001)(25786009)(2906002)(74316002)(217423001)(77096006)(33656002)(53936002)(99286003)(6436002)(54906002)(9686003)(10090500001)(189998001)(105586002)(50986999)(3280700002)(54356999)(76176999)(10290500003)(101416001)(6506006)(2900100001)(102836003)(6246003)(6116002)(7736002)(5660300001)(305945005)(6916009)(110136004)(81156014)(81166006)(53546010)(4326008)(8936002)(15650500001)(14454004)(86362001)(86612001)(229853002)(3660700001)(68736007)(7696004)(2950100002)(8990500004)(8676002)(5005710100001)(226483002);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR21MB0766;H:MWHPR21MB0190.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Aug 2017 02:17:57.0594 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR21MB0766 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v7U2I7J7001071 Content-Length: 1116 Lines: 18 > -----Original Message----- > From: Christoph Hellwig [mailto:hch@infradead.org] > Sent: Sunday, August 13, 2017 3:24 AM > To: Long Li > Cc: Steve French ; linux-cifs@vger.kernel.org; samba- > technical@lists.samba.org; linux-kernel@vger.kernel.org; Long Li > > Subject: Re: [[PATCH v1] 15/37] [CIFS] SMBD: Post a SMBD data transfer > message with data payload > > You can always get the struct page for kernel allocations using virt_to_page > (or vmalloc_to_page, but this code would not handle the vmalloc case either), > so I don't think you need this helper and can always use the one added in the > previous patch. I partially addressed this issue in the V3 patch. Most of the duplicate code on sending path is merged. The difficulty with translating the buffer to pages is that: I don't know how many pages will be translated, and how many struct page I need to allocate in advance to hold them. I try to avoid memory allocation in the I/O path as much as possible. So I keep two functions of sending data: one for buffer and one for pages.