Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19234474rwd; Wed, 28 Jun 2023 06:54:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5s44VTYUXJPh/YKdlfNTVl/uS3Vqf83zOwFxlyJEysUeq9zfHjTD1apsNNg9PQ98r1tQia X-Received: by 2002:a17:906:5395:b0:991:bf04:2047 with SMTP id g21-20020a170906539500b00991bf042047mr7439922ejo.14.1687960447373; Wed, 28 Jun 2023 06:54:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687960447; cv=none; d=google.com; s=arc-20160816; b=p8MBY2RQ/19ic4AJUj/K7KjzyoG9Hw0APHoEB1FOA0K7tz6Lkkq4IzObGYI22QRmFg tlFdjQLLewEcD2eZlyOJZuaUueydX7gy9yFmu21eyGtDl6KzOFZMdeNAsOOR8GfltbB1 ofYuusUDydX77+jZTTQleGKouu0lJxxTO4g0i7/JWi4oAAZgySXCeR1o6SWdyV6Yo1OW WJ+RITFc+7NOvRJyDKPGLwDQAH4wiLkP5lSoQO3Ee0l7jgiYwOmVqs6dV3XmYQ7LOr3I BfvEJFUAdmDnkPXbJIXEBo4SZJJe9qVJFs/CcXy0nVCCSUQ4FsN1ewuI6LYmuZK8gPOu nmzw== 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=ILSaV7SEbZMYRZS2QLMojuBNjtkSUW+dMP8xI7bFpVE=; fh=3DtDjy+qm2mKxT4PhD9WTKRbZFmgjURJ5LyxQ0kcJ64=; b=FbLAAobUlpm1h/mwfXjL5KJmc5d1bQ2dBmXvZ58VXSsfIkLIQYqlq/wqBNJPcIn7rG pSmbAGCKKAO4Xeg6R4FcbgFPEGremRBvz8Y/soFj31bJLWmLd5S9AAtFJxEA6ToiAelI vtRUl2mDuxvqbTrWR84bCE32DWkp/fymQllIEt5iQfpOotqzsKk8Wec1NWKWbWyvAIwa EX5DRZM2boITwvyCQ32acaNs0LIIE9BErFx93fQrD+fV6Xg7H/RU9iw2n1RYArhhF8m3 HSLwqVKvg7mSEJq/rvoifKS5mDEyv2APmMKnwmMIipGkCOcTwpjtttPmoE0Z/DI7WkZ+ e7hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DOe05T5U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f22-20020a170906049600b00988d6a7cdefsi5560437eja.212.2023.06.28.06.53.41; Wed, 28 Jun 2023 06:54:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DOe05T5U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231744AbjF1Nmp (ORCPT + 99 others); Wed, 28 Jun 2023 09:42:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:42840 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232072AbjF1Nmf (ORCPT ); Wed, 28 Jun 2023 09:42:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687959710; 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: in-reply-to:in-reply-to:references:references; bh=ILSaV7SEbZMYRZS2QLMojuBNjtkSUW+dMP8xI7bFpVE=; b=DOe05T5UCy3MEwlm39MaFRxA10AhX1Qq16wEaI+SXfGfJUzc7h17Om1m9P7bXvvS9Ni1Yx vnQOHLU5nOxInkgWfRgim4lIi3zW/eWUswSa5UlQ76PLeeV4Q19KI7K3/7XY2zgTDYBuQN gvpV0hx/KqkaaBZ+IFnfGs+opbO5NRY= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-674-4kkYsD1nODShuelVeQc5TQ-1; Wed, 28 Jun 2023 09:41:42 -0400 X-MC-Unique: 4kkYsD1nODShuelVeQc5TQ-1 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-7655fffd637so123687685a.1 for ; Wed, 28 Jun 2023 06:41:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687959694; x=1690551694; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ILSaV7SEbZMYRZS2QLMojuBNjtkSUW+dMP8xI7bFpVE=; b=FvxanTQaI8PVHAKfu5WMTGMPACpi3HUJVLVFTG6FzpPNHqP7kgajqkLx/kbWY8ksRr wUVTLXZIlRBXmWxW2HZdxPiz2JijZ6x0dbGOX++Jhnpt8ylOfzxHnj29Xd+epa5nZCVr FRuBsNdfCz5T00niFULkWu6BaCoG8GxEp0Q72D3nNiTKtfklvODnQxYZQpyTUiH4IPy1 FgDElo+iaf7JMZeH5NmZDz4f3vLu5hK8M3NuceLUopXbIT1hpaoSpeluozHoimi84X89 IFH/ZIemPNSgUuCpA3WZNRPc2696bPvXt5X6OGKvvvPCqi9tyA6KkD3bwvjgX2ecvxZi biSg== X-Gm-Message-State: AC+VfDxOFyZr9L7KLUfeEnSB91r7Ulngy2aP884cpAkHDnHTYQfaz59b 6RwqSiDi+v8FwgWa2qw5bg9j7ZSWNfh/6QER1XMiImMvQBynorb84QMrQAINXScOxuitc97gx12 u72PosCUnQxipo0Xas+DpMNRI X-Received: by 2002:a05:620a:31a8:b0:767:1573:d36e with SMTP id bi40-20020a05620a31a800b007671573d36emr4488742qkb.3.1687959694165; Wed, 28 Jun 2023 06:41:34 -0700 (PDT) X-Received: by 2002:a05:620a:31a8:b0:767:1573:d36e with SMTP id bi40-20020a05620a31a800b007671573d36emr4488725qkb.3.1687959693901; Wed, 28 Jun 2023 06:41:33 -0700 (PDT) Received: from x1n (cpe5c7695f3aee0-cm5c7695f3aede.cpe.net.cable.rogers.com. [99.254.144.39]) by smtp.gmail.com with ESMTPSA id w15-20020a05620a128f00b007594a7aedb2sm5045644qki.105.2023.06.28.06.41.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jun 2023 06:41:33 -0700 (PDT) Date: Wed, 28 Jun 2023 09:41:31 -0400 From: Peter Xu To: Suren Baghdasaryan Cc: akpm@linux-foundation.org, willy@infradead.org, hannes@cmpxchg.org, mhocko@suse.com, josef@toxicpanda.com, jack@suse.cz, ldufour@linux.ibm.com, laurent.dufour@fr.ibm.com, michel@lespinasse.org, liam.howlett@oracle.com, jglisse@google.com, vbabka@suse.cz, minchan@google.com, dave@stgolabs.net, punit.agrawal@bytedance.com, lstoakes@gmail.com, hdanton@sina.com, apopple@nvidia.com, ying.huang@intel.com, david@redhat.com, yuzhao@google.com, dhowells@redhat.com, hughd@google.com, viro@zeniv.linux.org.uk, brauner@kernel.org, pasha.tatashin@soleen.com, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v4 3/6] mm: drop per-VMA lock when returning VM_FAULT_RETRY or VM_FAULT_COMPLETED Message-ID: References: <20230628071800.544800-1-surenb@google.com> <20230628071800.544800-4-surenb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230628071800.544800-4-surenb@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 28, 2023 at 12:17:57AM -0700, Suren Baghdasaryan wrote: > handle_mm_fault returning VM_FAULT_RETRY or VM_FAULT_COMPLETED means > mmap_lock has been released. However with per-VMA locks behavior is > different and the caller should still release it. To make the > rules consistent for the caller, drop the per-VMA lock when returning > VM_FAULT_RETRY or VM_FAULT_COMPLETED. Currently the only path returning > VM_FAULT_RETRY under per-VMA locks is do_swap_page and no path returns > VM_FAULT_COMPLETED for now. > > Signed-off-by: Suren Baghdasaryan Acked-by: Peter Xu -- Peter Xu