Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp61664pxy; Wed, 21 Apr 2021 18:33:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVv4Unz6gRq1dl+Zr5Xzhk7BoGl5m+PSsIlqbZC4ozhrYiwpjeNmzoY0wOp+pMKN10gDpb X-Received: by 2002:a05:6a00:24c9:b029:25f:dce7:d660 with SMTP id d9-20020a056a0024c9b029025fdce7d660mr946005pfv.57.1619055193517; Wed, 21 Apr 2021 18:33:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619055193; cv=none; d=google.com; s=arc-20160816; b=mO014ZGxfh5RJBz7Sm3UwG4oaO51emDmUa//LY/6OBEPcoCe9AU9Z3+2iqKEcd+ucn jt0bsfLxG5GnCLFun+gZoc1H3WbdAUDUIXC40kfeyRapfskLPcug+BPuJpMsb7A0RoWo CfSmXQvabIFYczdrbrnjzRIuEWaOkm3yYOfG0xwJaJIAIq33eHy+Wrl5aqi+qIzAlqHq BSZMH2zNDYov9LP2Pes0iZOHncMouvzuAmh7Ll599ZktVxQWA697UdXneLl+han/4uin tF2g0zlVRA+bdDspdhM58+GYAiKnRAT42Am/6fiqxG1J55HxY5wJTiHwqR0w2UlOBA91 vsOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=VRNWJ7dwbgZwlJyhYfwGgpaJzbScF/7s6fzKyBnonnk=; b=ipUkv3zIMPj99+P+IsxhSlosTEzNNi5ORlMBir568qy0Ttk5qsyUf+M7zN+8p7U8yL 3jHPP5fNONNdGVQfg9YYmdtp5/ql8RxtSVdOBXd1mvv+z1hnGrDzw6k/ywvA4wboiouY 7slSPcu4mN9qD180M7CKUvnU9SsfCxVMHUJOjljAhNyHJO5YJ88T/sX6aWCgd1qO2KtN /4l3/yiM3WpLyZwQuBkmIJhX0PjXs07s3yQPleTm8ego3LkVUbskr7ZQpVXLzoo+EVMD pxQKtHfu+iEhGtTRmJFS5lT+xtmoo+avseLgbvMAdlmgq0Ib4695Ttp6VScGqpxVkeLD iZ7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=WtR6qF+F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v65si1193607pfb.4.2021.04.21.18.33.01; Wed, 21 Apr 2021 18:33:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=WtR6qF+F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235588AbhDVBIF (ORCPT + 99 others); Wed, 21 Apr 2021 21:08:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230338AbhDVBH6 (ORCPT ); Wed, 21 Apr 2021 21:07:58 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08830C06174A; Wed, 21 Apr 2021 18:07:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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; bh=VRNWJ7dwbgZwlJyhYfwGgpaJzbScF/7s6fzKyBnonnk=; b=WtR6qF+FGYDnWHNpr57Amm2uZk ZgQuQYsiGxtuRwxgwalTqgLJID5Xudtgan2AHAeyR9GnxsHku9D0Au88l9Yp1FylXEuang+V9AgNX W3Ut/B+QNa7FXpswe5iQmJQD9vUJjTRdu50fGl/hVEJe0wwvYUD2gfscP4OrpgURDThZCrZcqHGMv kSuC25KwvxN7vHm3opYhbdp+aUt+SXdxC01mzy3FZ4ZtUtw0V2EYvk6lib5d+5gUZU57+zncdBD+M gEZpNUh8Wxziorc+1auBCeqSuHK9fWV/5G6Rc5c2EQxU7fpo67nO6zwkUGXMLMnTI84qzCHt7DsBy 99LU24HA==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lZNna-00HGPa-Uh; Thu, 22 Apr 2021 01:06:35 +0000 Date: Thu, 22 Apr 2021 02:06:30 +0100 From: Matthew Wilcox To: Hugh Dickins Cc: Andrew Morton , William Kucharski , Christoph Hellwig , Jan Kara , Dave Chinner , Johannes Weiner , "Kirill A. Shutemov" , Yang Shi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 1/2] mm/filemap: fix find_lock_entries hang on 32-bit THP Message-ID: <20210422010630.GK3596236@casper.infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 21, 2021 at 05:37:33PM -0700, Hugh Dickins wrote: > - if (!xa_is_value(page) && PageTransHuge(page)) > - xas_set(&xas, page->index + thp_nr_pages(page)); > + if (!xa_is_value(page) && PageTransHuge(page)) { > + unsigned int nr_pages = thp_nr_pages(page); > + > + /* Final THP may cross MAX_LFS_FILESIZE on 32-bit */ > + xas_set(&xas, page->index + nr_pages); > + if (xas.xa_index < nr_pages) > + break; > + } Aargh. We really need to get the multi-index support in; this works perfectly when the xas_set() hack isn't needed any more.