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=-6.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 6093CC433DB for ; Tue, 29 Dec 2020 19:04:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D6E7F207CF for ; Tue, 29 Dec 2020 19:04:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D6E7F207CF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0F94C8D0035; Tue, 29 Dec 2020 14:04:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 082358D002C; Tue, 29 Dec 2020 14:04:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EB36A8D0035; Tue, 29 Dec 2020 14:04:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0024.hostedemail.com [216.40.44.24]) by kanga.kvack.org (Postfix) with ESMTP id D09518D002C for ; Tue, 29 Dec 2020 14:04:13 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 916E4180AD80F for ; Tue, 29 Dec 2020 19:04:13 +0000 (UTC) X-FDA: 77647245186.07.night93_1d16c732749e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id 7309E1803F9A4 for ; Tue, 29 Dec 2020 19:04:13 +0000 (UTC) X-HE-Tag: night93_1d16c732749e X-Filterd-Recvd-Size: 2571 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Tue, 29 Dec 2020 19:04:12 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id B095B207BD; Tue, 29 Dec 2020 19:04:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1609268651; bh=ffPMj1yl0t55UFvL8DR/1pnYLFgb/BU5SmeZ55STWzU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dKN+Offne8Iv6Yuk6MjQtKBW2MWzzJfObFQyaOxs/IpVii6LZ8T3+0QkVWRHkSJPF YSKDF7wp/yFoUQ1QY70TseozUFwGqUUlnnazl8kavzNZ8xcsp37TTllBT+Fysxaek3 dQZyD7V6K0IxiTN9xS2TTEDEqXNMoAF9KVz0dFcw= Date: Tue, 29 Dec 2020 11:04:10 -0800 From: Andrew Morton To: Helge Deller Cc: Kalesh Singh , "Kirill A. Shutemov" , Linus Torvalds , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org, James Bottomley , John David Anglin Subject: Re: [PATCH] mm: fix extend calculation for move_page_tables() Message-Id: <20201229110410.f2ad1655bacb2dd381be7a07@linux-foundation.org> In-Reply-To: <20201229174517.GA31435@ls3530.fritz.box> References: <20201229174517.GA31435@ls3530.fritz.box> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Tue, 29 Dec 2020 18:45:29 +0100 Helge Deller wrote: > On parisc the kernel fails to start the init process because in > shift_arg_pages() in fs/exec.c, move_page_tables() is called to e.g. > move pages from start addr 0xffeff000 to the new start addr 0xf9ccb000 > with a length of 0x1000 bytes, but move_page_tables() instead returns > that it apparently moved 0x57000 bytes. Since the number of bytes is > different than the number of bytes which should have been moved, > shift_arg_pages() aborts with -ENOMEM. > > Debugging shows that commit c49dd34018026 ("mm: speedup mremap on > 1GB or larger regions") is the culprit. > In this commit, the extent calculation was tried to be optimized, but > got it wrong for this case. > The patch below reverts to the previous way to calculate the extent and > thus fixes the boot problem. > Thanks. The same as https://lkml.kernel.org/r/20201219170433.2418867-1-kaleshsingh@google.com. I'll get that sent to Linus today.