From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.1 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FSL_HELO_FAKE,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C456FC4CED1 for ; Fri, 4 Oct 2019 12:43:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 84B0720862 for ; Fri, 4 Oct 2019 12:43:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="SDadIs6c" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 84B0720862 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2EEFE6B0003; Fri, 4 Oct 2019 08:43:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 277F26B0005; Fri, 4 Oct 2019 08:43:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 118A08E0003; Fri, 4 Oct 2019 08:43:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0203.hostedemail.com [216.40.44.203]) by kanga.kvack.org (Postfix) with ESMTP id DD6336B0003 for ; Fri, 4 Oct 2019 08:43:30 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 8B9E66C3A for ; Fri, 4 Oct 2019 12:43:30 +0000 (UTC) X-FDA: 76006068180.07.pets29_17b9c409d047 X-HE-Tag: pets29_17b9c409d047 X-Filterd-Recvd-Size: 4570 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Fri, 4 Oct 2019 12:43:30 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id q10so3877594pfl.0 for ; Fri, 04 Oct 2019 05:43:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+3cqXuQcaFN/VntPTldGPlJjAqOO9AvS0M1U11Ovk1c=; b=SDadIs6cScwMULRTeDO8uEHTjB6x33RGyIxABkrwwW3ZDHFc/0nhikeYnFDsCWJ+Uu 0d+yi+kzeH6yd4iH01HxeNWQZGUyJQMGaZAuXej1do1ptl1mmrVtPjZQoQSZU78SthxD il21R251bB/Vmlh/TwjBfohmN78FuedGI6IkzScbOx5OPkjXSo0aEUbelmyqjE9oY3cZ vcdLI7UmyOyrKAtnkSYSVf3nxtZVmYPDP9TbTBKUX9aH6O+zyPL5Kdhf8Mt2pgRmUiEi St2nqw5X9yWmLbBYFgmOmmx9/mb5VV8uxZaeL8TBMC7C74SX6DjPFV097m089IpH14tv Q6eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+3cqXuQcaFN/VntPTldGPlJjAqOO9AvS0M1U11Ovk1c=; b=Yi3zhdwjmCW3suJ8aLzOjjWslM/RAbFphvv+O6AIZ1llEMeLZW1SfCJqiAbzO5jYBe NkoT8ZPtDEteCd6ID/1GcT9Qf2xpq0du7xxQN7e3V3Z0fAFUlEAuTHKpwvIULmTQ9dms rukcQxsKRZmENCy2xV67ardrzmPEIuJEWYPnK8Y9vHwihdY0s4+44bvE3Gth2T8InrJP L3sGTZ9uziVRsrKWiyWlYBdbQubLulRnTunWP3Mmzc2C7FYNLCVOIDOqd1a6zBro/7mW IrE3fvJyU7lQlabIB068S2SmSqOWCn9lXAcbXf9vNR+Gbd3TTjFzn0BpqKTKRQVHUtEY Uwxg== X-Gm-Message-State: APjAAAUU/mfKET32+fnaJZkogBdYJYc4fwHB3oH0Bwi9ST8PpnLxwHFa T8LaSQTv/JjKoVhWac1MMEW+7g== X-Google-Smtp-Source: APXvYqwrBu7MsPYZ8FG9D4/hc+Zhpd+amMqjP2ga4VhO8msAfB0tohBaeKFpQF9xhhF7Zg1Pmy7UGA== X-Received: by 2002:a63:1401:: with SMTP id u1mr14866540pgl.73.1570193008611; Fri, 04 Oct 2019 05:43:28 -0700 (PDT) Received: from google.com ([2620:15c:2cd:202:668d:6035:b425:3a3a]) by smtp.gmail.com with ESMTPSA id z13sm6601080pfg.172.2019.10.04.05.43.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2019 05:43:27 -0700 (PDT) Date: Fri, 4 Oct 2019 05:43:25 -0700 From: Michel Lespinasse To: Matthew Wilcox Cc: Davidlohr Bueso , akpm@linux-foundation.org, peterz@infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org Subject: Re: [PATCH -next 00/11] lib/interval-tree: move to half closed intervals Message-ID: <20191004124325.GB11046@google.com> References: <20191003201858.11666-1-dave@stgolabs.net> <20191003203250.GE32665@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191003203250.GE32665@bombadil.infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Oct 03, 2019 at 01:32:50PM -0700, Matthew Wilcox wrote: > On Thu, Oct 03, 2019 at 01:18:47PM -0700, Davidlohr Bueso wrote: > > It has been discussed[1,2] that almost all users of interval trees would better > > be served if the intervals were actually not [a,b], but instead [a, b). This > > So how does a user represent a range from ULONG_MAX to ULONG_MAX now? > > I think the problem is that large parts of the kernel just don't consider > integer overflow. Because we write in C, it's natural to write: > > for (i = start; i < end; i++) > > and just assume that we never need to hit ULONG_MAX or UINT_MAX. > If we're storing addresses, that's generally true -- most architectures > don't allow addresses in the -PAGE_SIZE to ULONG_MAX range (or they'd > have trouble with PTR_ERR). If you're looking at file sizes, that's > not true on 32-bit machines, and we've definitely seen filesystem bugs > with files nudging up on 16TB (on 32 bit with 4k page size). Or block > driver bugs with similarly sized block devices. > > So, yeah, easier to use. But damning corner cases. Yeah, I wanted to ask - is the case where pgoff == ULONG_MAX (i.e., last block of a file that is exactly 16TB) currently supported on 32-bit archs ? I have no idea if I am supposed to care about this or not... -- Michel "Walken" Lespinasse A program is never fully debugged until the last user dies.