Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp518272rwd; Wed, 31 May 2023 01:23:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7JRUCmXN7OR/XvddVUNqSugnzmdSzr77rg4kLljVF9kc9W5SoolyM6EzZWbb/268Qr97Xd X-Received: by 2002:a05:6870:9896:b0:19f:9ab7:26a8 with SMTP id eg22-20020a056870989600b0019f9ab726a8mr2968785oab.54.1685521381511; Wed, 31 May 2023 01:23:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685521381; cv=none; d=google.com; s=arc-20160816; b=IZXF06lu1TlPNNU3GK3MJ/DLFZ9dG2xVMwPqgSKL542reZxannwOU01PanIew7k7tE 5GqqP7Pxk7E/4AoSOwCw5KOGHc6KjkgPM2vmIMicIpAqKBBcfjLw+RePhrEUmeT30Tv/ 3rRWQgEnkrWug81RsWVXXt150C9YgONVq71/TsSQDrN+ffjNolHjntqr2fQ4WQ1y9+yp G88est3ScvVrKXebh3aQUXUaUvD3F9hRa1OXSZ49qV1lIhe0Pm92o/yOOyZHUMHMBWy0 tZWE4OHkitddw9vl3XZDWjwq/DaFar+QfFTQnzLz2uaPljWQwrOJCz2wOMVOrOaZ4dSt MT+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=lAEIqyTQIqAgpwEz1m8TesLih/MrDXD4GJgP6XrJJHQ=; b=I6xtSi2oY1VBVAwyf9skqI2vFwA1bQGfV+CJ0YyC2pteX1FnIao6nF0j1dubmiXxW1 5IbWbQqoXe88nO6lLgF0eK+nTZUW1u1eCN8NIg/+9/PO0s0igMv3LF8hB4nURAUPohj+ KRTtVFuaZ7ViAHsiXfpQCcJRrK4tmTO0wGJdYTTkAZ1cESrUCmvwpbpCdixFCHNgsMht 8qRTPIfWhQ3nMkye31xB6lsFt13VmWiyz995xnMTCfmOGzzuhMPj4tOY7U4EYuo18My+ umfxNvqEIYVo40gAvv71lQbE5KYggU6z3DPKFV9wu2uZkJQK3yHtWBigdeWVpB8po+A8 KMSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P51VlisM; 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 bk13-20020a056a02028d00b0053faf25b178si594026pgb.365.2023.05.31.01.22.48; Wed, 31 May 2023 01:23:01 -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=P51VlisM; 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 S234589AbjEaHrc (ORCPT + 99 others); Wed, 31 May 2023 03:47:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233199AbjEaHra (ORCPT ); Wed, 31 May 2023 03:47:30 -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 3118F93 for ; Wed, 31 May 2023 00:46:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685519201; 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=lAEIqyTQIqAgpwEz1m8TesLih/MrDXD4GJgP6XrJJHQ=; b=P51VlisMD7pWCRbQ0yjMZdUEFDH0xkj1rsaheKA3ZkOrwjW8ePAPimITJu2dOel1izfwoL xeyIKE9TzdGmRYhHjF2f3tlgIHLi45G2PAYZ+3AHiibrtc7410QvB6+KIGcdw/hYppq3iG etnTAd83yhM3SF+UVEkDC3r6R6/d9GU= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-582-vasp2XFTO86tv5XkKDwX7g-1; Wed, 31 May 2023 03:46:40 -0400 X-MC-Unique: vasp2XFTO86tv5XkKDwX7g-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-3f603fed174so33848395e9.2 for ; Wed, 31 May 2023 00:46:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685519199; x=1688111199; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lAEIqyTQIqAgpwEz1m8TesLih/MrDXD4GJgP6XrJJHQ=; b=AtEWNO8BUrgk+7cj6j5XO5QXAZ7Kq7x6yUToiO3KAFR1HMXU9dTxOaUfBoL9w1n7+O FguD+Md7eGxM173gbrf59VbmEqAQSnvEmnSiSuDYZW8LxmN17/W3H7EPgsXIIoxJq7c4 i7N7EBo3bJxIsAu4jzeqiPDZB4M2vpLSZ4yW4IV2woJBPFA5pR8V199glHFLaJU3Lwzt 2/K30M/YAstXRUFrIet0CW6qYLAQcPLicXC5xECiE7+XA0hRAmUq5fM8TUui7g4SX4ey As/mM4maXTheLC81VbdumDixx9xSL0yowpmIF3/h8KoFpH8MINEAuKm7r14WqLq/Xz5m Y04A== X-Gm-Message-State: AC+VfDxYUlshsJJedrq0PNEwoEMGcCVIpBdHCFTXg+jdbrSLeOSGnhj3 aIRxb1uQfBWGAZs3M2oOCkjqQjsq3dD8hTyLZSucOCGo4mPYnWifbIZiKuVK7TUxOXys1UMFfy9 YcAiw+b34MVeuBAUcQXx80n2g X-Received: by 2002:a05:600c:294c:b0:3f4:2374:3512 with SMTP id n12-20020a05600c294c00b003f423743512mr3473978wmd.18.1685519198915; Wed, 31 May 2023 00:46:38 -0700 (PDT) X-Received: by 2002:a05:600c:294c:b0:3f4:2374:3512 with SMTP id n12-20020a05600c294c00b003f423743512mr3473958wmd.18.1685519198688; Wed, 31 May 2023 00:46:38 -0700 (PDT) Received: from ?IPV6:2003:cb:c749:cb00:fc9f:d303:d4cc:9f26? (p200300cbc749cb00fc9fd303d4cc9f26.dip0.t-ipconnect.de. [2003:cb:c749:cb00:fc9f:d303:d4cc:9f26]) by smtp.gmail.com with ESMTPSA id d13-20020a5d4f8d000000b0030ae69920c9sm5748797wru.53.2023.05.31.00.46.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 31 May 2023 00:46:38 -0700 (PDT) Message-ID: <9493177b-c435-9adc-cdfc-e45b91f02e77@redhat.com> Date: Wed, 31 May 2023 09:46:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH -V3 4/5] swap: remove get/put_swap_device() in __swap_duplicate() Content-Language: en-US To: Huang Ying , Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yosry Ahmed , Hugh Dickins , Johannes Weiner , Matthew Wilcox , Michal Hocko , Minchan Kim , Tim Chen , Yang Shi , Yu Zhao , Chris Li References: <20230529061355.125791-1-ying.huang@intel.com> <20230529061355.125791-5-ying.huang@intel.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20230529061355.125791-5-ying.huang@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29.05.23 08:13, Huang Ying wrote: > __swap_duplicate() is called by > > - swap_shmem_alloc(): the folio in swap cache is locked. > > - copy_nonpresent_pte() -> swap_duplicate() and try_to_unmap_one() -> > swap_duplicate(): the page table lock is held. > > - __read_swap_cache_async() -> swapcache_prepare(): enclosed with > get/put_swap_device() in __read_swap_cache_async() already. > > So, it's safe to remove get/put_swap_device() in __swap_duplicate(). > > Signed-off-by: "Huang, Ying" > Reviewed-by: Yosry Ahmed > Cc: David Hildenbrand > Cc: Hugh Dickins > Cc: Johannes Weiner > Cc: Matthew Wilcox > Cc: Michal Hocko > Cc: Minchan Kim > Cc: Tim Chen > Cc: Yang Shi > Cc: Yu Zhao > Cc: Chris Li > --- Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb