Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S3000603AbdD3KXE (ORCPT ); Sun, 30 Apr 2017 06:23:04 -0400 Received: from cmccmta2.chinamobile.com ([221.176.66.80]:19255 "EHLO cmccmta2.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163688AbdD3KWz (ORCPT ); Sun, 30 Apr 2017 06:22:55 -0400 X-RM-TRANSID: 2ee65905bafba96-2132a X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee65905bafa797-e7992 Subject: Re: [PATCH v6 1/2] tcmu: Add dynamic growing data area featuresupport To: Mike Christie , nab@linux-iscsi.org References: <1493187952-13125-1-git-send-email-lixiubo@cmss.chinamobile.com> <1493187952-13125-2-git-send-email-lixiubo@cmss.chinamobile.com> <59057AC0.2090804@redhat.com> Cc: agrover@redhat.com, iliastsi@arrikto.com, namei.unix@gmail.com, sheng@yasker.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Jianfei Hu From: Xiubo Li Message-ID: <5f6a28f7-62ab-1096-625c-c42db78af99d@cmss.chinamobile.com> Date: Sun, 30 Apr 2017 18:22:51 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <59057AC0.2090804@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1218 Lines: 36 On 2017年04月30日 13:48, Mike Christie wrote: > On 04/26/2017 01:25 AM, lixiubo@cmss.chinamobile.com wrote: >> for_each_sg(data_sg, sg, data_nents, i) { >> @@ -275,22 +371,26 @@ static void alloc_and_scatter_data_area(struct tcmu_dev *udev, >> from = kmap_atomic(sg_page(sg)) + sg->offset; >> while (sg_remaining > 0) { >> if (block_remaining == 0) { >> - block = find_first_zero_bit(udev->data_bitmap, >> - DATA_BLOCK_BITS); >> block_remaining = DATA_BLOCK_SIZE; >> - set_bit(block, udev->data_bitmap); >> + dbi = tcmu_get_empty_block(udev, &to); >> + if (dbi < 0) > > I know it you fixed the missing kunmap_atomic here and missing unlock in > tcmu_queue_cmd_ring in the next patch, but I think normally people > prefer that one patch does not add a bug, then the next patch fixes it. Do you mean the following kmap_atomic() ? from = kmap_atomic(sg_page(sg)) + sg->offset; In this patch there has no new kmap/kunmap introduced. This is the old code and the kunmap is at the end of aasda(). This as the initial patch, the memory is from slab cache now. But since the second patch followed will covert to use memory page from the buddy directly. Thanks, BRs Xiubo Li