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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 771CFC433F5 for ; Mon, 3 Oct 2022 21:27:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229716AbiJCV1d (ORCPT ); Mon, 3 Oct 2022 17:27:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbiJCV1J (ORCPT ); Mon, 3 Oct 2022 17:27:09 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CB595B7B8 for ; Mon, 3 Oct 2022 14:17:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664831821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yDq2aLp/FgG9bJgxiiUy2Vo1uVdxseE75P7hxe9A1A0=; b=bM+jm6Qe8UbVG38HepGU5+rzNGUQCDFAmr7ux2FlH8JWtVtPA6IPXH1E1uyaUIajDCzeSI w9pGKAP85vhJGReWW6t8FAN8b/iW3SSmCSMi+CJibDbXTiPgnf6pEFqiE3In0ZuTQdGnoo 5G5abjflfg0OO/mGAoTMU8e723JR5iI= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-62-VtHNbt3TPaiK94zqz0r8DQ-1; Mon, 03 Oct 2022 17:17:00 -0400 X-MC-Unique: VtHNbt3TPaiK94zqz0r8DQ-1 Received: by mail-qt1-f199.google.com with SMTP id ay22-20020a05622a229600b0035bbb349e79so8109801qtb.13 for ; Mon, 03 Oct 2022 14:17:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date; bh=yDq2aLp/FgG9bJgxiiUy2Vo1uVdxseE75P7hxe9A1A0=; b=Z3EFEhpq01rRbeNnk1JIxkHu+L/Ur6MlAYMi4y5pizUXY9PkAz4eaVDujJRVp2Y+nr mNqw5NZNizMH8J/O3uuSIHixFu3rpxAseIJ8Ly8B4zmA2QeB70T4pa1xuWggC2wH3lIZ 6OFz+TN4jPiPRl/gNffJCOQVhuYnFSZWyv5E4w0OkYEpfTNfoFaQ9bos2lyOgyHTldm3 dhwrZLKiWJ86tO8XMSmzPZ/hiwfWBgAkh3/jnoaIFKJz81+wwefQes62QN/F3kJEQDtb 9WdYQ4WrixE7V0HyLdczGHLfw3PzO4mgj8vi4WlRB8XvK8vWqSLbquqwf0/lIQ0NyvJ3 W/gQ== X-Gm-Message-State: ACrzQf3Vfrxwub2Z6hrBZldSaFilzwHnukiPEaOAMEc+R/dVgBtzazGh /PzdKvWjRxfZtLJod+QYLyRAhjAxKbaj3tQMMthlsWy8KkjESb3SIa5YkKxbh0q43+PVtbNxzMK Sq9QbJvRRecUqciBcY1jAtK92 X-Received: by 2002:ae9:e8c3:0:b0:6cf:5ed0:2109 with SMTP id a186-20020ae9e8c3000000b006cf5ed02109mr14877016qkg.253.1664831819458; Mon, 03 Oct 2022 14:16:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5SZlqkT0U+6Cvh13pMnEk4getg+MtGiZceGmAdqfbS5hL6KnwRj4x/XoNJ6dcyGlP6cJcwwg== X-Received: by 2002:ae9:e8c3:0:b0:6cf:5ed0:2109 with SMTP id a186-20020ae9e8c3000000b006cf5ed02109mr14877001qkg.253.1664831819281; Mon, 03 Oct 2022 14:16:59 -0700 (PDT) Received: from x1n (bras-base-aurron9127w-grc-46-70-31-27-79.dsl.bell.ca. [70.31.27.79]) by smtp.gmail.com with ESMTPSA id e9-20020ac86709000000b0035d44917542sm10363073qtp.37.2022.10.03.14.16.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 14:16:58 -0700 (PDT) Date: Mon, 3 Oct 2022 17:16:55 -0400 From: Peter Xu To: Nadav Amit Cc: LKML , Linux MM , Andrea Arcangeli , Mike Rapoport , David Hildenbrand , Andrew Morton , Axel Rasmussen , Mike Kravetz Subject: Re: [PATCH 1/3] mm/hugetlb: Fix race condition of uffd missing/minor handling Message-ID: References: <20221003155630.469263-1-peterx@redhat.com> <20221003155630.469263-2-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 03, 2022 at 02:00:36PM -0700, Nadav Amit wrote: > On Oct 3, 2022, at 8:56 AM, Peter Xu wrote: > > > > > + */ > > + if (hugetlb_pte_stable(h, mm, ptep, old_pte)) > > + ret = hugetlb_handle_userfault( > > + vma, mapping, idx, flags, haddr, > > + address, VM_UFFD_MISSING); > > + else > > + /* Retry the fault */ > > + ret = 0; > > Might be unrelated, but at least for the sake of consistency if not > potential GUP issues, don’t you want to return VM_FAULT_RETRY ? VM_FAULT_RETRY implies releasing of mmap sem, while we didn't? -- Peter Xu