Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp288577ybp; Thu, 3 Oct 2019 13:37:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqyhQvH6XZsYY0EqQS5a73MVNIMmw5GeSUej3UOOOopNtjFfSEaFoArLziuygyGoksB8DAPu X-Received: by 2002:aa7:c98a:: with SMTP id c10mr11926473edt.23.1570135053006; Thu, 03 Oct 2019 13:37:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570135052; cv=none; d=google.com; s=arc-20160816; b=DWKSkc4ZAMcZXNwJTphMt2RDMGRybUv0SEWvT1IKu6MweUxPx4pA7Uptu7A75OZ6Vj I9nHSdihZedfOzEaKwUf+hr87yKFuEDtskwCE79WgLrfU1uvtdqHXbrEXwFXpG+OOI8/ 00RSiC5y0VmeIr4gqWB27A+qb8HoO/zqKqwgyBug1JVZlFRP8ZuVyorqA4TN2N8W1l/E GS4l+V8xdnNrQLt1/m+e2IQwLG1ezJIbqL84JqJ7hHJWvPt2tMued1xLNib4KNLkGVcI c1cOpPSkGgYwwF5Um3M+XE2yEKDM6j/N1UdPUaeIhAQEKGDMeoc0edMC9VVFfArpIxWZ jO2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DuwMGQIzbvieUCH04dpyi9AiTx6jv704Pfn5oVeJ17U=; b=Ooomtu+B/vYcJ0FJNDJou2VLARJelQdnaL2t2w7n7PImomwA++vAwZKbGQYxZ7QbXv cb1u1C1DKgyBL32XWa8xDnZZf11cHO5LDlsBsPWjWzkcQbdyADv4d3xCRaC90WknByQU qlpruHIe3O7K9KOT6XhIxjOOi0+vLZPPRn6v6edrpSN5PUnELKKH5jROhccDStOSpB+i Lfb03icpjRA+VaClN0N2B6cx/IxaT1W0zTXVj8p1fHYYA7ZB5nan0V6FL30va/+pJTNb 8C0gATGfqRldktBUgUzU3/gvi6f8/k5Lj9uw/naVQsI5Ml6GxDGQ0GP1pnh5gPEmhYIC pq+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=RYxhot7m; 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 c28si2225441ede.3.2019.10.03.13.36.17; Thu, 03 Oct 2019 13:37:32 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=RYxhot7m; 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 S2388841AbfJCUcy (ORCPT + 99 others); Thu, 3 Oct 2019 16:32:54 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:33282 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729311AbfJCUcy (ORCPT ); Thu, 3 Oct 2019 16:32:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=DuwMGQIzbvieUCH04dpyi9AiTx6jv704Pfn5oVeJ17U=; b=RYxhot7mP0JyjcYaAZEScfO1B 6EJMyUWXlNdT3UDcTvRnHCNreWLXGGY7iNXJWyn8XMRiBWuyKwXKAiNt97SK5zlHmjecIp1vV4QWf 3MMmDQuoXudCRIc3Pntnzk2D+nvYpA8R+DX19eIvAyEP60ti312vCUTZKPIKYOvqoGA7oPhRxWmsb 1wYUz+J1z5n5H4HBkA3jKBidq9Notx4vPfLBTylntN2b7ob3ZWf6Kqj8qAvdy6F2hUPeIbiIPuwzR 7gp1Xw/1/mREnXHy2ysx3SPtsTRHHROdIH4BPHiovRiPo+t+ICndCH/x22GYqYbq3CHBGXVgVRR/X UqAc4SSkg==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.2 #3 (Red Hat Linux)) id 1iG7mM-0006xH-SJ; Thu, 03 Oct 2019 20:32:50 +0000 Date: Thu, 3 Oct 2019 13:32:50 -0700 From: Matthew Wilcox To: Davidlohr Bueso Cc: akpm@linux-foundation.org, walken@google.com, 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: <20191003203250.GE32665@bombadil.infradead.org> References: <20191003201858.11666-1-dave@stgolabs.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191003201858.11666-1-dave@stgolabs.net> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.