Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2933926ybi; Sun, 26 May 2019 10:42:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqywFKa5YBNhIW9CPl74XqPF03PJDJ+YiBUECcBVBaG4FTlMRJxOO+UPYJQ/wrfBapJZlXmy X-Received: by 2002:a17:902:7591:: with SMTP id j17mr62938040pll.200.1558892574314; Sun, 26 May 2019 10:42:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558892574; cv=none; d=google.com; s=arc-20160816; b=NfaQ9jHCnBYDbD7FkkOBDg6snMLHO0vkhTEdT0UW7hKc+BRSe7jbsyGX8FX41aNFet YO/hiz1mWuLydYRWIZB2cwOVS4tVPtnbnRJQmOxQ4NB2TGcWns/Ulno0bk4yr/sZTaGs NV+dLzMZvCVCeNpiJpIz4jPbkAjTHtpvrnt7nJP6YUF2YxAFsta66A+LGIrcWSgHcUBo YgGYKBf3WG3jgvQAkNx7WXbV3w/QrakBb+kxbczh8tb+8o78OvZzUIrIZPhVlBsJDRPW 0DuCW0Kw+aCqPiIim9uOuCD3G7tTCLrXqO7TRysqmZ43Y1fr5Ad6IC6kZocFAHAO+Ljm 3ujg== 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; bh=uBxgdWpNrCpZkjyq48bAbxY/E4kBjXC2I2OkPOfuQK0=; b=VZCN3GFV30UJfAKk2wTmWbVoTbXdCSwThKhqXso1HeIhEaDcoZ4wQ8nKuM0dXFFWqK G5RV0uEJI/HkIpg8lSQgNYSg2BN54zfqY8y8O88jNpVbztntrOoMtGbQW194AgaGJnam Kf5ZU9qoG2zJiIrGU/MJxxOrLUZOKOQKJaOTbafkSaCF/EI9SpMZf93gyBtR+YEYiO5D kNjdubK5zG1EqEO1MJK57KJAjSFDmJ2v8J8huZdTu0oWqbv9A3NrJ54QHDO47nMFKjBI g8fSANq6u2OJwzQ+1JNwln/VtceNZQ2JreK3838SUH3YTOEBYxfHJ3iCql78ODkOTuzq gyow== ARC-Authentication-Results: i=1; mx.google.com; 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 p7si16652333pfb.213.2019.05.26.10.42.37; Sun, 26 May 2019 10:42:54 -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; 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 S1727972AbfEZR0K (ORCPT + 99 others); Sun, 26 May 2019 13:26:10 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:53611 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727926AbfEZR0K (ORCPT ); Sun, 26 May 2019 13:26:10 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 021E4803F7; Sun, 26 May 2019 19:25:57 +0200 (CEST) Date: Sun, 26 May 2019 19:25:09 +0200 From: Pavel Machek To: Hugh Dickins Cc: Sebastian Andrzej Siewior , Andrew Morton , Mike Rapoport , Andrea Arcangeli , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Borislav Petkov Subject: Re: [PATCH] mm/gup: continue VM_FAULT_RETRY processing event for pre-faults Message-ID: <20190526172509.GC1282@xo-6d-61-c0.localdomain> References: <1557844195-18882-1-git-send-email-rppt@linux.ibm.com> <20190522122113.a2edc8aba32f0fad189bae21@linux-foundation.org> <20190522194322.5k52docwgp5zkdcj@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 2019-05-24 15:22:51, Hugh Dickins wrote: > On Wed, 22 May 2019, Sebastian Andrzej Siewior wrote: > > On 2019-05-22 12:21:13 [-0700], Andrew Morton wrote: > > > On Tue, 14 May 2019 17:29:55 +0300 Mike Rapoport wrote: > > > > > > > When get_user_pages*() is called with pages = NULL, the processing of > > > > VM_FAULT_RETRY terminates early without actually retrying to fault-in all > > > > the pages. > > > > > > > > If the pages in the requested range belong to a VMA that has userfaultfd > > > > registered, handle_userfault() returns VM_FAULT_RETRY *after* user space > > > > has populated the page, but for the gup pre-fault case there's no actual > > > > retry and the caller will get no pages although they are present. > > > > > > > > This issue was uncovered when running post-copy memory restore in CRIU > > > > after commit d9c9ce34ed5c ("x86/fpu: Fault-in user stack if > > > > copy_fpstate_to_sigframe() fails"). > > I've been getting unexplained segmentation violations, and "make" giving > up early, when running kernel builds under swapping memory pressure: no > CRIU involved. > > Bisected last night to that same x86/fpu commit, not itself guilty, but > suffering from the odd behavior of get_user_pages_unlocked() giving up > too early. > > (I wondered at first if copy_fpstate_to_sigframe() ought to retry if > non-negative ret < nr_pages, but no, that would be wrong: a present page > followed by an invalid area would repeatedly return 1 for nr_pages 2.) > > Cc'ing Pavel, who's been having segfault trouble in emacs: maybe same? The emacs segfault was always during process exit. This sounds different... I don't see problems with make. But its true that at least one of affected machines uses swap heavily. Best regards, Pavel