Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp2009162pxb; Mon, 13 Sep 2021 09:58:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2+iDIsHFMUIVNQhjK9wn1+Lce67umHV1tAsXVhfySeVRWupkLydc3eQx26GpMYaOf+d3c X-Received: by 2002:a05:6402:411:: with SMTP id q17mr8008434edv.35.1631552287863; Mon, 13 Sep 2021 09:58:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631552287; cv=none; d=google.com; s=arc-20160816; b=yMxSpfmq0TtFh+Xq2JCnWVa/3Qtb9aeRUg3n0rEr+dWoKvTzfwcmW/pMZlJgKPVoHV JUGsTw0Kk2gkHBVlytJNdUga/c1KOP/2mSctXpqQ1/cv9o06gSaxGGeglXaAV1HgPIA/ erVPu1gTcFUWzuvN8Yle8Hrj+RIBzaJFCYCaKrwPhXNwVgfMqxquVBdUhu9XTb1d9ykJ ylVQm6VLmKfIYSik1xU5HseFsxh6ZeluwGrrfdGMNEeXSoPEqxTIK9j7L3axwfk0cd/k msqY4HH16CGHsC+y8Kb/VEO6aIhvyAJAdBHvFMVtx9uJYu2W57BfstdtCRQCeHn6z7nX WDfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=5FGvKa6/SY7v3aG+gp0qf1IhE5WNXd9rsEH3ZXI2TfM=; b=LdHTcfsE6O/XK3qdC17xaCFfDrT1uE73yrZnLioaNveHFoZFCN+tbSQuMUfvDxrObF CgwGpetc6o0VcE0HKcCy4EKWyWEEdOR1fOe/quwGB974tNXhk0iAqALwjuvOWHZSng32 XVA3IVIRk8kCMRkaNtNLCYKqQ+hkm6flyiXyFXxw/c7zHiEbzn73EUeNHLt5W59Clad9 oUF2iMY4ouTbJtzuAVG0m5cmWtIyCNNeBA+up0cI0GD5/MGQY/n+0tbxCdbbq4/kxiZ1 cUUFSDIDr9mkZ86bvHpP8V6i79cTKDn+Uw6m6JBrpWFlAbdS6UI+sSZ+zzOxKkAIjqzx RWsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=WKNmc8Fs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jz16si2423106ejc.774.2021.09.13.09.57.43; Mon, 13 Sep 2021 09:58:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=WKNmc8Fs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240756AbhIMQ5K (ORCPT + 99 others); Mon, 13 Sep 2021 12:57:10 -0400 Received: from relayfre-01.paragon-software.com ([176.12.100.13]:54288 "EHLO relayfre-01.paragon-software.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239888AbhIMQ5J (ORCPT ); Mon, 13 Sep 2021 12:57:09 -0400 Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayfre-01.paragon-software.com (Postfix) with ESMTPS id A62971D40; Mon, 13 Sep 2021 19:55:51 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1631552151; bh=5FGvKa6/SY7v3aG+gp0qf1IhE5WNXd9rsEH3ZXI2TfM=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=WKNmc8FsMpBC0NASRjIZvxdS9DzRFCkA6Z/h9fwLWBrJB9rlcvq/76GQEhwvlD+xN eZZYciJwxLjJSgyL4/OKXzjwcNTk5ZVoP+BFZGgNeDJIX2eekQYrbw44E/wbVaWJ/A rbs0trEHA+m3+xkA6z2pe7g2s2bN74capqaUm5jI= Received: from [192.168.211.103] (192.168.211.103) by vdlg-exch-02.paragon-software.com (172.30.1.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 13 Sep 2021 19:55:51 +0300 Message-ID: Date: Mon, 13 Sep 2021 19:55:50 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [PATCH 0/3] fs/ntfs3: Make entry binary search faster Content-Language: en-US To: Kari Argillander , CC: , Joe Perches References: <20210902154050.5075-1-kari.argillander@gmail.com> From: Konstantin Komarov In-Reply-To: <20210902154050.5075-1-kari.argillander@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.211.103] X-ClientProxiedBy: vobn-exch-01.paragon-software.com (172.30.72.13) To vdlg-exch-02.paragon-software.com (172.30.1.105) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02.09.2021 18:40, Kari Argillander wrote: > This series will make binary search faster with removing the need of > allocations. We will only use stack memory. This will also make possible > to remove linear search completely. > > It is good also point out that full binary search not quite fit with > entry search because entrys are not always same size. This why we first > need linear table fill algorithm. My implementation try to use the fact > that we should not linear fill full table before not doing any checking > of the entrys. It is example 50/50 change if we are in middle that entry > is in first half. So it is very inefficient to fill table after we are > middle point. > > We could also predict how many entrys there is and use this information, > but I did not do that in this point. I'm more than happy to improve this > more if someone has ideas. > > I have tested this with xfstests and did not see regressions. Checkpatch > and build tests for every patch have been done. I haven't done major > bench marking with this one. Idea that this is better is just my two > cent. Paragon has hopefully done bencmarking with old binary search > compared to linear search? I'm quite certain that this will win old > binary search algorithm because no need for allocations. > > Thanks Joe for let me notice this improvement. > > Kari Argillander (3): > fs/ntfs3: Limit binary search table size > fs/ntfs3: Make binary search to search smaller chunks in beginning > fs/ntfs3: Always use binary search with entry search > > fs/ntfs3/index.c | 153 ++++++++++++++--------------------------------- > fs/ntfs3/ntfs.h | 3 - > 2 files changed, 45 insertions(+), 111 deletions(-) > > > base-commit: d3624466b56dd5b1886c1dff500525b544c19c83 > Hi Joe, Kari! Applied, thanks!