Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3974479ybi; Mon, 10 Jun 2019 21:56:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqzS2pD5mvB/lDjbqyxZl7/Ld7V5D4mseZ0ZVK0sfrC42z8/+JYVNJOQYKzQhulSlcJx0Dpl X-Received: by 2002:aa7:92da:: with SMTP id k26mr25420591pfa.70.1560228983996; Mon, 10 Jun 2019 21:56:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560228983; cv=none; d=google.com; s=arc-20160816; b=LjuY4ZXv6JydyO0WQIs+1+l6h7qtv/h5yjiJ7BT2YqOSd3tkMoMLTpNcThSbP3Nkrt UmM9x0QzkbACp01b2cqKfFLK+gw/ycwYmT6hY3wjawgIwNT8d6W+tARKw36f67Bzk/H9 jivgftIuD29vNVihrtNDbinSpQch0GIhPd4kfdx/UwjRDwb6RjbIMENQm2c2Ke3gpyUH JnIz7FHtSXYy00wqAnDol3Yv0B3b5Cx9qh0Mzg3+HvwfsBOr8xtBV8f5Q7AXvwdhzmj6 1Qe04BSQ78JQiGyiuEHHbZZmQO7jowrMI8KGSN7WhJJQQhjIU+Zh2lSlbuvyaStI9uBG EqgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+0NVFIKvZo+cTD+d9Ui7mDkyi5Oxsx4RGqTwt9X3ykk=; b=TzN5LXpYTGu7Dnc+Emtz1NE3l58EiuxdSJYn9oYMvvBGxgn9dCSBpqdpppy2FwACoe RIuUQSJo8+0JiG2F8gwtqQTLYRTeB97LQ1WLpVjqwuIPAN/Pgw+yuw3cT3wARsBMkgPo gw0d7R1tg8OKiCS8RKzYH9CNpvhv2vQvXNVEuECfNGsnf6MGZxmoia0R6fGljGTBm1kt 543qxrvuPblUBBgTqHeTaEKl9ZiQE1VCVp3h/szT7mX97+0M1jI4OFNQ79Br5oWIVMna L1JO8Udyu96d5dLK7duBnL1DXvqDhelQ1Lyg6FeZNOlKdjCAR8SwMdc3djNhD8s3Igqr 7s4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=J42kFBk4; 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 d92si12006190pld.262.2019.06.10.21.56.09; Mon, 10 Jun 2019 21:56:23 -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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=J42kFBk4; 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 S2391087AbfFKEzg (ORCPT + 99 others); Tue, 11 Jun 2019 00:55:36 -0400 Received: from mail-lj1-f174.google.com ([209.85.208.174]:36357 "EHLO mail-lj1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390081AbfFKEzg (ORCPT ); Tue, 11 Jun 2019 00:55:36 -0400 Received: by mail-lj1-f174.google.com with SMTP id i21so10167949ljj.3 for ; Mon, 10 Jun 2019 21:55:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+0NVFIKvZo+cTD+d9Ui7mDkyi5Oxsx4RGqTwt9X3ykk=; b=J42kFBk4S2k8nsKBY9fwhx/vZSEYU/OLrOlYGuYtsIl7R1OW7G6cP1AqGwj2+yGLg2 EYdlAVSm3K888i1Z/0BN2vG2wscFrXTIpee8gDD08eNXZ7Iutd7Co9x7wrC2XzSTo6Wr D0e1tE4Z4fwwQjCOh4OvXBe5BDfZKYbAU0USA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+0NVFIKvZo+cTD+d9Ui7mDkyi5Oxsx4RGqTwt9X3ykk=; b=NCQNep3gNqDa/EZUXUvgPh+B3aQ/ShnI0FzforyY8VAUcNAEIB8Vz71PdfeffPnLSh /K8P+5c4Z7VlZ9HE7CYeQfCtfuXM/dUEk5Ni3WHBR02sExvgdgNAyT5OaYnAv0ZnfVmP Egef4SXeydORuVS1JxR4FUwDoI6ouR/L+quXYgvd32/j3/0JzNYk3oWz64qXW7e3eeR5 Qj9VepEjmWnu0IUTlVkqwSelWjFB8kH6oiTDK8oTgjanGEFzeLulWvt3xONwED7zW9F/ Go7OK/IYuhuWBgCLR6vPcC1VphQ7unoN9fyCZIRXBUjOkjyEUoslEDha+ZwtTaD8nvIo 4v/A== X-Gm-Message-State: APjAAAUHe3+2nlAEUR1pP4hDUVDJoYDr8gmKKWBMpTNQFwTLUjRG5d/R a6IPobouYbIXjqs2EWq8LrtpCkis2+U= X-Received: by 2002:a2e:9dca:: with SMTP id x10mr7195153ljj.17.1560228933691; Mon, 10 Jun 2019 21:55:33 -0700 (PDT) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com. [209.85.208.182]) by smtp.gmail.com with ESMTPSA id s20sm2297017lfb.95.2019.06.10.21.55.32 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jun 2019 21:55:32 -0700 (PDT) Received: by mail-lj1-f182.google.com with SMTP id s21so10171516lji.8 for ; Mon, 10 Jun 2019 21:55:32 -0700 (PDT) X-Received: by 2002:a2e:9c03:: with SMTP id s3mr23108926lji.209.1560228931996; Mon, 10 Jun 2019 21:55:31 -0700 (PDT) MIME-Version: 1.0 References: <20190610191420.27007-1-kent.overstreet@gmail.com> <20190611011737.GA28701@kmo-pixel> In-Reply-To: <20190611011737.GA28701@kmo-pixel> From: Linus Torvalds Date: Mon, 10 Jun 2019 18:55:15 -1000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: bcachefs status update (it's done cooking; let's get this sucker merged) To: Kent Overstreet Cc: Dave Chinner , Waiman Long , Peter Zijlstra , Linux List Kernel Mailing , linux-fsdevel , linux-bcache@vger.kernel.org, "Darrick J . Wong" , Zach Brown , Jens Axboe , Josef Bacik , Alexander Viro , Andrew Morton , Tejun Heo Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 10, 2019 at 3:17 PM Kent Overstreet wrote: > > > > Why does the regular page lock (at a finer granularity) not suffice? > > Because the lock needs to prevent pages from being _added_ to the page cache - > to do it with a page granularity lock it'd have to be part of the radix tree, No, I understand that part, but I still think we should be able to do the locking per-page rather than over the whole mapping. When doing dio, you need to iterate over old existing pages anyway in that range (otherwise the "no _new_ pages" part is kind of pointless when there are old pages there), so my gut feel is that you might as well at that point also "poison" the range you are doin dio on. With the xarray changes, we might be better at handling ranges. That was one of the arguments for the xarrays over the old radix tree model, after all. And I think the dio code would ideally want to have a range-based lock anyway, rather than one global one. No? Anyway, don't get me wrong. I'm not entirely against a "stop adding pages" model per-mapping if it's just fundamentally simpler and nobody wants anything fancier. So I'm certainly open to it, assuming it doesn't add any real overhead to the normal case. But I *am* against it when it has ad-hoc locking and random anti-recursion things. So I'm with Dave on the "I hope we can avoid the recursive hacks" by making better rules. Even if I disagree with him on the locking thing - I'd rather put _more_stress on the standard locking and make sure it really works, over having multiple similar locking models because they don't trust each other. Linus