Received: by 10.223.185.116 with SMTP id b49csp2417747wrg; Mon, 5 Mar 2018 02:29:14 -0800 (PST) X-Google-Smtp-Source: AG47ELvA4rLZYnbXtnrOYIWx9yhao1Nia/e5jxRX8TYlg9XehgxXGGBkVgfPrnTBeAT7a2Vhtpp+ X-Received: by 2002:a17:902:2803:: with SMTP id e3-v6mr12626878plb.238.1520245754459; Mon, 05 Mar 2018 02:29:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520245754; cv=none; d=google.com; s=arc-20160816; b=AD9GLJetilo5W2VQHEy6Lx0vFqPXbnzJ5lXVc8NZ2QKzLqW+0suP7agfw5UbQFpxrW ixO5gYolOvXp4pVLrmF4i5KzkicFNvlxcTDKeEq2bm88xTMxS01KoSycxERDzQEQPA8h JgBGQH5LgXsEAyFFB6BoOGJe2VSaxp87w0/RO6zpOESwXXAV2Y3/B4TOHtvsX9J3Cg6S oTYxoFzBLiwPRIN19qrvg1fQXeRi9E+LLmFr3b2xXiRFMweIDLZhCsLzv/78u7p3jAoR 5s5ODX5zVY8+Z66TjQi5+2WpW2Km/JV36n0OZKg5kmTqA6241EXVIOQ3nbD0QhZyU2MP XqPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:arc-authentication-results; bh=20BUBFYjKa1M4nqaVWTtocjG6Jwf2+/dQS98P+q3scM=; b=xPb30GcNOxkRr+dldpqnq/1N/7mN01/jM6mKcoO6UMOOs+Yyo+TdtDSRffY6Y6NdwB CivEV2I3PYXeeEXD+1W4stehCkfd1y5qICVJEJWtvtSWZ/pR2v28F0FCMldehLktRW9O I/a9HyD9hXCN2feMQeqHsdMO7XTw90r0KOvQHKWnmMhIe8M5g3ze0PTZm4aogSIWDS0R miKZhhhpLmI5HS/6qNGOsU6pOTc2P/hit3u0zhZmBPDQxtPLzCYkFL4Ba0lk5hGiXGRL fkL8+sitXH0qp0erPDqNmKx8c2M7saB4H63O0BPENPqnZMd26VFIPyIvzUepxURty5of VI/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 18si10025988pfh.118.2018.03.05.02.28.59; Mon, 05 Mar 2018 02:29:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933151AbeCEKTu (ORCPT + 99 others); Mon, 5 Mar 2018 05:19:50 -0500 Received: from mail-qt0-f195.google.com ([209.85.216.195]:33954 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933004AbeCEKTr (ORCPT ); Mon, 5 Mar 2018 05:19:47 -0500 Received: by mail-qt0-f195.google.com with SMTP id l25so19715575qtj.1 for ; Mon, 05 Mar 2018 02:19:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=20BUBFYjKa1M4nqaVWTtocjG6Jwf2+/dQS98P+q3scM=; b=pF8BE0puTWC+rwHHety1LFgRqG9queMSv/bCy9Xu9vDNm0fk54LTKYygP9uW1wvWfV y5eQno20FHaXWgq3JZbcDmLVpG5kgGiPVGITTevv814NVN7olLvR9JxiRAZBym9Z59Xy Nb+P1YwKMpWATQtJJoJ8dMZeQ+bEhxA706LiAF3+WmdSh78Wr1avoOSHw+ES+DOWrNZi p6jjHJZKtQ8I64Q05hGc+vbx4Lg0l4pdNbcTdiResbwYyGe3ImOT5wPo2lR0lHxc4tvM /5gIUAK6sCK3BKpQRSVKaY1mH2NmuV7fPmWLKtVFWDqoupqhYiBeNTPyHRxU03f6qR6Z vzxg== X-Gm-Message-State: AElRT7FGpBCtPhXaTLsbBfljJUvYDhNXGrqeCPI+m5CbhUjBubw5ncZo MGQ6CBARyJ5oh1LqbKKmt4+GS29PeaZFCPIGOf9BUjcurX0= X-Received: by 10.200.22.81 with SMTP id x17mr22431415qtk.326.1520245186686; Mon, 05 Mar 2018 02:19:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.87.101 with HTTP; Mon, 5 Mar 2018 02:19:46 -0800 (PST) In-Reply-To: <20180302163603.GQ19312@magnolia> References: <20180228154951.31714-1-vbendel@redhat.com> <20180301224800.GI12763@magnolia> <20180302163603.GQ19312@magnolia> From: Vratislav Bendel Date: Mon, 5 Mar 2018 11:19:46 +0100 Message-ID: Subject: Re: [PATCH] xfs: Correctly invert xfs_buftarg LRU isolation logic To: "Darrick J. Wong" Cc: linux-xfs@vger.kernel.org, Brian Foster , linux-kernel@vger.kernel.org, djwong@kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (In response to Luis' comment:) > Can you add a respective Fixes: tag? It was apparently present since LRU was added to xfs buffer cache via: commit 430cbeb86fdcbbdabea7d4aa65307de8de425350 [xfs: add a lru to the XFS buffer cache] But I wouldn't say this patch "fixes" that commit. What do you think? Should a fixes tag be added in this case? > Also what effects are observed by > the user when this happens on the kernel log? I haven't spotted any differences visible to user, nor in the kernel log. (In response to Brian's comment:) >> However, as per documentation, atomic_add_unless() returns _zero_ >> if the atomic value was originally equal to the specified *unsless* value. >> > Nit: unless Thanks very much for feedback. Since it's my very first upstream commit-proposal, I expected that some polish would be needed. > It might be worth pointing out in the commit log that currently isolated > buffers end up right back on the LRU once they are released, because > ->b_lru_ref remains elevated. Therefore, this patch essentially fixes > that circuitous route by leaving them on the LRU as originally intended. > Otherwise this looks Ok to me: So the final commit message could be: ~~~ Currently the xfs_buftarg_isolate() is causing an xfs_buffer with zero b_lru_ref, to take another trip around LRU, while isolating buffers with non-zero b_lru_ref. Additionally those isolated buffers end up right back on the LRU once they are released, because ->b_lru_ref remains elevated. Fix that circuitous route by leaving them on the LRU as originally intended. >> Signed-off-by: Vratislav Bendel > Reviewed-by: Brian Foster > ---