Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp992929imm; Thu, 4 Oct 2018 06:42:30 -0700 (PDT) X-Google-Smtp-Source: ACcGV62USG1OrN/cFIpkYaJqJUUTzqZSCJjAzACOqKG7NjgKvO/6XNFxFGcFRzruzKJ3SCQyt8m/ X-Received: by 2002:a62:594f:: with SMTP id n76-v6mr7023383pfb.42.1538660550635; Thu, 04 Oct 2018 06:42:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538660550; cv=none; d=google.com; s=arc-20160816; b=zBUt0ME0IM9kmdr0vx1Miu2QTJ4iYHt8lGr1D2oy/qEmTCwUO+atjdhIuvTiH2qRsn FN52S745oGF4aOn5TqsneVAVLPZujsikqaEp0zt3OAB19H11rhJnCYoEa57he//0tgbM /aGNF0io8QdjZ4+oIZ//dklhxzKjzmGzoQ7L8MnuBBsybV3zBUyebbaXJt+v8LwHys2V hAtPfnaxKKL7uU8uFOE1WCVNYEaQdDRZceCskOR/fGXNXg3jD8qPKMdMFU6XqjAnpLzL Gv+UcL7UxBXs491BCs4fUnpcpPQNDmeUdzuAZ1/n9PigNF64ww5EkxA6H8sHezTxG5+Z 9WbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=aJBo373gdQPmW1bj8FGutfGp4TY84WpOCZjg8C3XPgw=; b=dfeuWDwDLuwj2N4I4473h6rt9+30t2ufTnbUBJ/fGVR+c6tfF9Uqvdc57nwWMg5kz8 FdymcRXoDIwo0QYXAXrc0IJt0zhzQbi9/Zb4cC/thxtx2kESZY1ftkuQ12nDI+I6S5cJ PRVEqSNmwv2N8OpzMTKr/kLTQ+jv7Yma8OGkmzVjHIhg5Lo8gaKkHOq8JttNCzmx8jXC gRWq7T7kBs2HoJNTX1pLr8Uq2bG23x4UOcT2QeteJkpJq2n4RQlpub/Kn9own79zfzzp 0xF61PpcITWq2ip95EThGYEyeYNfEkhrI4XXoR1SiujlNBRgE7uvQLoqpmuLYlD4E1HC ENOA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r1-v6si5139591plb.166.2018.10.04.06.42.14; Thu, 04 Oct 2018 06:42:30 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727540AbeJDUfU (ORCPT + 99 others); Thu, 4 Oct 2018 16:35:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38784 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727264AbeJDUfU (ORCPT ); Thu, 4 Oct 2018 16:35:20 -0400 Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 848394628E; Thu, 4 Oct 2018 13:41:58 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-55.bos.redhat.com [10.18.17.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 65FFD9E7C7; Thu, 4 Oct 2018 13:41:56 +0000 (UTC) Subject: Re: [PATCH v9 5/5] lib/dlock-list: Scale dlock_lists_empty() To: Jan Kara Cc: Alexander Viro , Jan Kara , Jeff Layton , "J. Bruce Fields" , Tejun Heo , Christoph Lameter , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Andi Kleen , Dave Chinner , Boqun Feng , Davidlohr Bueso , Davidlohr Bueso References: <1536780532-4092-1-git-send-email-longman@redhat.com> <1536780532-4092-6-git-send-email-longman@redhat.com> <20181004071600.GC29482@quack2.suse.cz> From: Waiman Long Organization: Red Hat Message-ID: <5bcdf2a2-6d03-df21-934d-6c989549253b@redhat.com> Date: Thu, 4 Oct 2018 09:41:56 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20181004071600.GC29482@quack2.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 04 Oct 2018 13:41:59 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/04/2018 03:16 AM, Jan Kara wrote: > On Wed 12-09-18 15:28:52, Waiman Long wrote: >> From: Davidlohr Bueso >> >> Instead of the current O(N) implementation, at the cost >> of adding an atomic counter, we can convert the call to >> an atomic_read(). The counter only serves for accounting >> empty to non-empty transitions, and vice versa; therefore >> only modified twice for each of the lists during the >> lifetime of the dlock (while used). >> >> In addition, to be able to unaccount a list_del(), we >> add a dlist pointer to each head, thus minimizing the >> overall memory footprint. >> >> Signed-off-by: Davidlohr Bueso >> Acked-by: Waiman Long > So I was wondering: Is this really worth it? AFAICS we have a single call > site for dlock_lists_empty() and that happens during umount where we don't > really care about this optimization. So it seems like unnecessary > complication to me at this point? If someone comes up with a usecase that > needs fast dlock_lists_empty(), then sure, we can do this... > Yes, that is true. We can skip this patch for the time being until a use case comes up which requires dlock_lists_empty() to be used in the fast path. Cheers, Longman