Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6347991ybv; Wed, 12 Feb 2020 10:27:25 -0800 (PST) X-Google-Smtp-Source: APXvYqzbqxSEVKNTJh78fbymvpzpl9OF1jDusF4yFfHdz3BklL6QJZOATmhkufmQ31OVywo7dLQo X-Received: by 2002:a9d:7586:: with SMTP id s6mr10155964otk.342.1581532044952; Wed, 12 Feb 2020 10:27:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581532044; cv=none; d=google.com; s=arc-20160816; b=hBAk0He0c0MjcbXmmwEr56nvT1wNboaBjgMu/U7euCeskrvu2y78DbSCIe5hV4VM5B E5nQ4qj9RlLBGoRC9adnxcW8hgIfYQarWDVembQeF5vxO4Ovok/cmurWu3rUiGta400S EKVC5q94oVVDkA4K0susg1YFwFZAzfYIvaDDoNGwcY0+kQ2dZUKdkrPDOrnCN0zKMXLY FjZ5DdO/L39y1zdPvCDOXCX37HFibjrWOL/yfX21pqeVVC8cqrUKIOAw3uJOl80ILurd nppdiZ+Qvwcy1azJfKanCtFgTl2OXz1uao5NqWa2IGrlKOxw7I0fuwkJ9LaTutmajmEb maLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=XvW92qXdXxcBdZyz3CB2bmvvmviEhSS5ie+KfpdB1tI=; b=WDp10xzLntumG9tsVyWz3cDX7WvucTqkG5vseygk+1Rc+rVvGdUfscriyJK6Tr3WYE UWHx7d1mKNfb8ENgsbWimnY2NBfmNqKuVm556wLlMQq2FPdQrNxzlDo++lAlN8JSN8Bf UEqJVemzLiRc8WibFTIWiqSk426JCw0V6cIhEcP9OAn719wlRJj3bYZX7ZC9weEERwNd vTrYM84TzxAQEP1lfs9F4IzLJBDf6AKEGkbNa7OvxUQXL2z5vWPMMJWLA+Ko9R/zhW+b iKNFaLnSntN4+Uja1cmoiU/NzKxbHc+i/LAQuJDeHZTdQstSFL8N7BgXtcHzqYmbqTWM mcmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QAybABBd; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d197si3465582oig.115.2020.02.12.10.27.11; Wed, 12 Feb 2020 10:27:24 -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; dkim=pass header.i=@kernel.org header.s=default header.b=QAybABBd; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728098AbgBLS0t (ORCPT + 99 others); Wed, 12 Feb 2020 13:26:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:51458 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727361AbgBLS0t (ORCPT ); Wed, 12 Feb 2020 13:26:49 -0500 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4EAD320714; Wed, 12 Feb 2020 18:26:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581532008; bh=n7uPnQHK86C/yR98ahD+dw8Skc2Kfc8eoGeK4vmmpQM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QAybABBdKYt0FzNsknY7TWmD/KpadhC97etcMMqZr2El8wcj7/EMLTUVl9rUaAKwa LVm97Saban54y9pGkZJqPXEV8uUcVkZdP9LRd+DL9uKFN0MLpGqEuSH3U88j/TJoql r66kO3t8IshxI+a/zQndlbA5LXeXF4NaLEP+nU7s= Date: Wed, 12 Feb 2020 10:26:45 -0800 From: Andrew Morton To: Johannes Weiner Cc: Rik van Riel , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Dave Chinner , Yafang Shao , Michal Hocko , Roman Gushchin , Linus Torvalds , Al Viro , kernel-team@fb.com Subject: Re: [PATCH] vfs: keep inodes with page cache off the inode shrinker LRU Message-Id: <20200212102645.7b2e5b228048b6d22331e47d@linux-foundation.org> In-Reply-To: <20200212163540.GA180867@cmpxchg.org> References: <20200211175507.178100-1-hannes@cmpxchg.org> <29b6e848ff4ad69b55201751c9880921266ec7f4.camel@surriel.com> <20200211193101.GA178975@cmpxchg.org> <20200211154438.14ef129db412574c5576facf@linux-foundation.org> <20200212163540.GA180867@cmpxchg.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 12 Feb 2020 11:35:40 -0500 Johannes Weiner wrote: > Since the cache purging code was written for highmem scenarios, how > about making it specific to CONFIG_HIGHMEM at least? Why do I have memories of suggesting this a couple of weeks ago ;) > That way we improve the situation for the more common setups, without > regressing highmem configurations. And if somebody wanted to improve > the CONFIG_HIGHMEM behavior as well, they could still do so. > > Somethig like the below delta on top of my patch? Does it need to be that complicated? What's wrong with --- a/fs/inode.c~a +++ a/fs/inode.c @@ -761,6 +761,10 @@ static enum lru_status inode_lru_isolate return LRU_ROTATE; } +#ifdef CONFIG_HIGHMEM + /* + * lengthy blah + */ if (inode_has_buffers(inode) || inode->i_data.nrpages) { __iget(inode); spin_unlock(&inode->i_lock); @@ -779,6 +783,7 @@ static enum lru_status inode_lru_isolate spin_lock(lru_lock); return LRU_RETRY; } +#endif WARN_ON(inode->i_state & I_NEW); inode->i_state |= I_FREEING; _ Whatever we do will need plenty of testing. It wouldn't surprise me if there are people who unknowingly benefit from this code on 64-bit machines.