Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp208928ybx; Mon, 4 Nov 2019 18:51:09 -0800 (PST) X-Google-Smtp-Source: APXvYqz8HdQzjIRp+9iK0bazg53pgHsI3PzaxtDZ7gWdVcrm/wkzy9VEfsJAf3bwcGVeJwQKMXgW X-Received: by 2002:a17:906:4019:: with SMTP id v25mr624878ejj.11.1572922269658; Mon, 04 Nov 2019 18:51:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572922269; cv=none; d=google.com; s=arc-20160816; b=MIzoqRf8pbPIzQpfZUwkQNi8Jm0auaufCDoQAv2D932HzsNW93RoHOmRKp1/Ek3d77 GLGJbWPzLMDtmSQomks2PbdX945s8b7MeAirydLEXC1QglE+bS+GwY1crSi9s3oRBPQc k4yryivzKi2HK1SDwoOIKz81lP1WFWy6rwfaRxM6mLuDT/x4FTxTdO2omnpVnaaVG6GV yAgG/0Ts2Lmzjycsk7OAPx0X3M66ICALVj/Bl3euPN0f4yCOqodiz7AhMzyKCHPc0fSt jygm8cKxpTLKV/7FNMbZy2FV46RJgUAtSNVYIf2SV9MKBvg36IRDlxbDyOVDy4Q3vDor Y9oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=mFBzB7rTI2ING7QmE78Odri+hoP/H84KClSZRicK2Nw=; b=X3V6OmQAWDKNLomWcsCaQiM3fGX+M8VHRw1qAQ7Glpid3oQEVntHkTMoB0Te6oKYuv E0XNQt+0tidJmECx9lXmt131H+h7sast61Po9cExqUhsbHrBU/5lDEDjSlz3JfwDKdxX e2zVEH84JW5x/e2Vqo5uubbh6U7XuvMc9fIC7hBAEjiXRS//QuXQpZKJgrjdEPuLq/m3 6iMc7pp/tbRWeHmmuHeTvgy8iO7/yTp2STEpHYIkYiUOLoIgvuBvFmhc7gCiGW4qrKHs dfPJATYzvRJ36JUdfQM5gMJo5LdY0huaHIrICRdbDp74GfDOwWpIteAAFPw1hhMymep8 xrHQ== ARC-Authentication-Results: i=1; mx.google.com; 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 x18si12752396ejo.78.2019.11.04.18.50.46; Mon, 04 Nov 2019 18:51:09 -0800 (PST) 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; 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 S1729836AbfKECtt (ORCPT + 99 others); Mon, 4 Nov 2019 21:49:49 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:59692 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727861AbfKECtt (ORCPT ); Mon, 4 Nov 2019 21:49:49 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 02C891ED94C3D443FDDB; Tue, 5 Nov 2019 10:49:48 +0800 (CST) Received: from [10.134.22.195] (10.134.22.195) by smtp.huawei.com (10.3.19.214) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 5 Nov 2019 10:49:44 +0800 Subject: Re: [PATCH 3/3] Revert "f2fs: use kvmalloc, if kmalloc is failed" To: Jaegeuk Kim , , References: <20191101095324.9902-1-yuchao0@huawei.com> <20191101095324.9902-3-yuchao0@huawei.com> <20191105000249.GA46956@jaegeuk-macbookpro.roam.corp.google.com> <40d0df3f-cc55-d31a-474b-76f57d96bd89@huawei.com> <20191105023835.GD692@sol.localdomain> From: Chao Yu Message-ID: <00ade77c-5451-4953-0232-89342a029f33@huawei.com> Date: Tue, 5 Nov 2019 10:49:43 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20191105023835.GD692@sol.localdomain> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/11/5 10:38, Eric Biggers wrote: > On Tue, Nov 05, 2019 at 10:17:41AM +0800, Chao Yu wrote: >> On 2019/11/5 8:02, Jaegeuk Kim wrote: >>> On 11/01, Chao Yu wrote: >>>> This reverts commit 5222595d093ebe80329d38d255d14316257afb3e. >>>> >>>> As discussed with Eric, as kvmalloc() will try kmalloc() first, so >>>> when we need allocate large size memory, it'd better to use >>>> f2fs_kvmalloc() directly rather than adding additional fallback >>>> logic to call kvmalloc() after we failed in f2fs_kmalloc(). >>>> >>>> In order to avoid allocation failure described in original commit, >>>> I change to use f2fs_kvmalloc() for .free_nid_bitmap bitmap memory. >>> >>> Is there any problem in the previous flow? >> >> No existing problem, however, it's redundant to introduce fallback flow in >> f2fs_kmalloc() like vmalloc() did, since we can call f2fs_vmalloc() directly in >> places where we need large memory. >> >> Thanks, >> > > f2fs_kmalloc() also violated the naming convention used everywhere else in the > kernel since it could return both kmalloc and vmalloc memory, not just kmalloc > memory. That's really error-prone since people would naturally assume it's safe > to free the *_kmalloc()-ed memory with kfree(). Agreed. Thanks, > > - Eric > . >