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=-2.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 ADA9EC32792 for ; Thu, 3 Oct 2019 20:41:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 71980207FF for ; Thu, 3 Oct 2019 20:41:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="HPp/6lAl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 71980207FF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 14E438E0007; Thu, 3 Oct 2019 16:41:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 127076B000A; Thu, 3 Oct 2019 16:41:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 03B5F8E0007; Thu, 3 Oct 2019 16:41:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0254.hostedemail.com [216.40.44.254]) by kanga.kvack.org (Postfix) with ESMTP id D58126B0007 for ; Thu, 3 Oct 2019 16:41:13 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 6F38682437C9 for ; Thu, 3 Oct 2019 20:41:13 +0000 (UTC) X-FDA: 76003643226.05.elbow25_27bbcf7f95748 X-HE-Tag: elbow25_27bbcf7f95748 X-Filterd-Recvd-Size: 2628 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Thu, 3 Oct 2019 20:41:12 +0000 (UTC) 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=IF1FolxTqmDTd/x1Q52V8Xh4wjuT53fQ+vxzesNKzJ0=; b=HPp/6lAlpE0Jvcw0rdXMwN6UV Qej28WAocyfIo02LqH1bwMfgUDN7ybvuwl0+oGgQuBeWy0LITlxanB/pj45j45ZRBLdIhq5Pg3136 Dgcb3313rfrD27i14BwWBF7m0E2O5Iz56LPUEKGa7IS5Ao3+SY6iYysrPd1aML6yWGke+g7yVFR7W 8lldEDb8wqcvmJstIdsdQIExY2L07IfV2Vkub3RjT+ig/PJeXyMklxJ26Oz80qEbvlXL/yv4eWlx7 i3zflHLA2zpZsBxy0V6NmrvFwk/5ymQToL5kmZ3jaq66pyYFINebi9urL29q1pHAjUhHvunoGCHbf tD2/xhL+w==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.2 #3 (Red Hat Linux)) id 1iG7uO-0001rj-Lm; Thu, 03 Oct 2019 20:41:08 +0000 Date: Thu, 3 Oct 2019 13:41:08 -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, Davidlohr Bueso Subject: Re: [PATCH 08/11] mm: convert vma_interval_tree to half closed intervals Message-ID: <20191003204108.GF32665@bombadil.infradead.org> References: <20191003201858.11666-1-dave@stgolabs.net> <20191003201858.11666-9-dave@stgolabs.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191003201858.11666-9-dave@stgolabs.net> User-Agent: Mutt/1.12.1 (2019-06-15) 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:18:55PM -0700, Davidlohr Bueso wrote: > +++ b/mm/nommu.c > @@ -1793,7 +1793,7 @@ int nommu_shrink_inode_mappings(struct inode *inode, size_t size, > size_t r_size, r_top; > > low = newsize >> PAGE_SHIFT; > - high = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; > + high = (size + PAGE_SIZE) >> PAGE_SHIFT; Uhh ... are you sure about this? size is in bytes here, and we're rounding up to the next page size. So if size is [1-4096], then we add on 4095 and get the answer 1. With your patch, if size is [0-4095], we get the answer 1. I think you meant: high = ((size + PAGE_SIZE - 1) >> PAGE_SHIFT) + 1;