Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2779376pxb; Tue, 21 Sep 2021 07:30:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyq9fFJeINgqO7gvoQouLJWKGBynM5yJuW4N85N7QIp/VSP1t8IfxpVJ0E/TbShfPyx+VVi X-Received: by 2002:aa7:c806:: with SMTP id a6mr35399013edt.354.1632234635420; Tue, 21 Sep 2021 07:30:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632234635; cv=none; d=google.com; s=arc-20160816; b=G4JEeoZzGNBu2LPpAlA0szKePfezLd4hVe27uLyNO3pfn1dictWwq5uL6ZVubmHfBx DGqRTN4ydOmIuOWxACUdpg67rvievNIUh2m6W03lzvJ50vJXfyGgDbiYTXrzM5ob/DFj S2NegzgjZTXk+liPp1inU9SYS8fM/S24I8rn5lP5bgYwr764aDl2kUcxTLtWQvf7cvij 93/ph+axnRDTnbkK+WhQD6nNVYeIKAk+hcxor2b0gvO13TFwijygfQ//U1pAeVPSpik3 mrVj1entj7q022tWw+NJO4P3JRDFJic4Q2SnVuTf+AT419HuC4iTmDa4l6TCEtH0eFCS svfA== 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=ML7arBHhpiOLgbzf0mlgusDukvs4IpHsLOPP9an2EcY=; b=RFpaNuPiCY87tmSwZ2tyB0WV0lDAsBYNvm7K6d8zCFvIkDznxbGfQXYkdjiZJJjdxX mws+V66z1f+iuGcXXgjaFcAhb7FriXMhNsmdRU/9CczO/aTHx8PtcWvFW9Xrti61zAYu nMIdy9xFT2xrej1ZfJQo8JFlW8uFAZDTxtiF3cY77BZBXKlBIEYBJ74jPL7on4IThSCh 8rkQ3QcuE+grLbtEvFL8r7hVCJlsNgdFkoB3BdrX8I9GrpFf3biDWJG9hU48Sk+a6n0z 3z56UbpVHw/1EBXY/8aMF/WWp7FRU2ryAjRLogTEOLCjVzQk69swQP7hT+HJhHgsHpyl H14Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=8PcY0Jw2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k10si20920663ejk.439.2021.09.21.07.30.09; Tue, 21 Sep 2021 07:30:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=8PcY0Jw2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233557AbhIUO3y (ORCPT + 99 others); Tue, 21 Sep 2021 10:29:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229577AbhIUO3x (ORCPT ); Tue, 21 Sep 2021 10:29:53 -0400 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85557C061574 for ; Tue, 21 Sep 2021 07:28:24 -0700 (PDT) Received: by mail-qk1-x733.google.com with SMTP id d207so29799332qkg.0 for ; Tue, 21 Sep 2021 07:28:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ML7arBHhpiOLgbzf0mlgusDukvs4IpHsLOPP9an2EcY=; b=8PcY0Jw2Zw2rvyeXJCUs183afxf9IsAmbA1SRcYydwror2+1VObYrZ+hbztfcDvURU KigJm/p06XVGB3jvk1QCg72iYnc5u6ICalT6a4RGjlimxUcTmcGTebDPIa8p+X83Xvso LDrclc1sc9zJCRvoNU/cWuBQM+DNzdVxHoOXU0wLOoJaEZxV9A+JSavxXB2W5JjIovVL 9blgqt/6UTyM4pmD+s8YC9qijtwJcT7IH2DUrU41pFivUOUxSUr5b9kxpTNDnI8fDqiX x554fAz2kqidBaPgPKYokC+g0/oGTy/PJBxLXve9/cIH4IRhuVzAqpOtoa8si59L34E+ kAZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ML7arBHhpiOLgbzf0mlgusDukvs4IpHsLOPP9an2EcY=; b=Sd/KzZspRmMcTm3nFLaoGi5jFuw5mH7NXdn6I9ievLe+ROGgdgdoFkudMKaRUu+j/T F4V59g10Nc7vAD/oFbRNQiDAzyk9bjSpWlqFQRA2MkaghmXY+VF1hOcdfRUdTvG/R1GT PM6cutOZo/pKIf5Ydrn9eRUxYfXMxWQOb2NbSbLroO9EaNeP157pkvDrfHq/AkerpiAC gr3JDFEW7hdPi7cuN5nV9ahQKdH2BfXNnNxpY1nDd49nvBm3kgo65GrHSxDJLhYRvlpt Xxk+/i/VE+jMwYdpGbpYv8urFF/rkfGTxUvk4DYTb1bH++cQIoL/NVHya3vG7Q1RFsDE PR1g== X-Gm-Message-State: AOAM533pPkypmdSkCDoeNyHTb4DkXEsYl58HRrdW0ICJoBAQK1DDfjCu I7SDpYdmQH53d+lJEEkN6bTPEEa+x/77rg== X-Received: by 2002:a05:620a:29c4:: with SMTP id s4mr27703811qkp.3.1632234501259; Tue, 21 Sep 2021 07:28:21 -0700 (PDT) Received: from localhost (cpe-98-15-154-102.hvc.res.rr.com. [98.15.154.102]) by smtp.gmail.com with ESMTPSA id z186sm14056056qke.59.2021.09.21.07.28.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 07:28:20 -0700 (PDT) Date: Tue, 21 Sep 2021 10:30:21 -0400 From: Johannes Weiner To: Yongmei Xie Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm:vmscan remove unnecessary lru lock unlock/lock pair Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Yongmei, On Sun, Sep 19, 2021 at 11:24:30PM +0800, Yongmei Xie wrote: > There's code redundant in move_pages_to_lru. When there're multiple of mlocked pages > or compound pages, the original implementation tries to unlock and then lock to handle > some exceptional case. > > Signed-off-by: Yongmei Xie > --- > mm/vmscan.c | 32 ++++++++++++++++++++++++-------- > 1 file changed, 24 insertions(+), 8 deletions(-) Is the lock cycling creating actual problems for you? The locks aren't batched because we expect those situations to be rare: mlock or truncate/munmap racing with reclaim isolation. And in fact, you're adding an unconditional lock cycle and more branches to the hot path to deal with it. It's more code overall. Without data, the patch isn't very compelling. If you do have data, it would be good to include it in the changelog. Thanks!