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=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 924FBC43387 for ; Wed, 9 Jan 2019 19:11:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5FFB3214C6 for ; Wed, 9 Jan 2019 19:11:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728052AbfAITLe (ORCPT ); Wed, 9 Jan 2019 14:11:34 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:44036 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726469AbfAITLd (ORCPT ); Wed, 9 Jan 2019 14:11:33 -0500 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B67F210D4; Wed, 9 Jan 2019 19:11:32 +0000 (UTC) Date: Wed, 09 Jan 2019 11:11:31 -0800 From: akpm@linux-foundation.org To: mm-commits@vger.kernel.org, stable@vger.kernel.org, rppt@linux.vnet.ibm.com, peterx@redhat.com, mike.kravetz@oracle.com, dgilbert@redhat.com, aarcange@redhat.com Subject: + mm-hugetlbc-teach-follow_hugetlb_page-to-handle-foll_nowait.patch added to -mm tree Message-ID: <20190109191131.ogKDU%akpm@linux-foundation.org> User-Agent: s-nail v14.9.6 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch titled Subject: mm/hugetlb.c: teach follow_hugetlb_page() to handle FOLL_NOWAIT has been added to the -mm tree. Its filename is mm-hugetlbc-teach-follow_hugetlb_page-to-handle-foll_nowait.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-hugetlbc-teach-follow_hugetlb_page-to-handle-foll_nowait.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-hugetlbc-teach-follow_hugetlb_page-to-handle-foll_nowait.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Andrea Arcangeli Subject: mm/hugetlb.c: teach follow_hugetlb_page() to handle FOLL_NOWAIT hugetlb needs the same fix as faultin_nopage (which was applied in 96312e61282ae ("mm/gup.c: teach get_user_pages_unlocked to handle FOLL_NOWAIT")) or KVM hangs because it thinks the mmap_sem was already released by hugetlb_fault() if it returned VM_FAULT_RETRY, but it wasn't in the FOLL_NOWAIT case. Link: http://lkml.kernel.org/r/20190109020203.26669-2-aarcange@redhat.com Fixes: ce53053ce378 ("kvm: switch get_user_page_nowait() to get_user_pages_unlocked()") Signed-off-by: Andrea Arcangeli Tested-by: "Dr. David Alan Gilbert" Reported-by: "Dr. David Alan Gilbert" Reviewed-by: Mike Kravetz Reviewed-by: Peter Xu Cc: Mike Rapoport Cc: Signed-off-by: Andrew Morton --- mm/hugetlb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/mm/hugetlb.c~mm-hugetlbc-teach-follow_hugetlb_page-to-handle-foll_nowait +++ a/mm/hugetlb.c @@ -4268,7 +4268,8 @@ long follow_hugetlb_page(struct mm_struc break; } if (ret & VM_FAULT_RETRY) { - if (nonblocking) + if (nonblocking && + !(fault_flags & FAULT_FLAG_RETRY_NOWAIT)) *nonblocking = 0; *nr_pages = 0; /* _ Patches currently in -mm which might be from aarcange@redhat.com are mm-hugetlbc-teach-follow_hugetlb_page-to-handle-foll_nowait.patch