Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp494079pxb; Wed, 27 Jan 2021 12:58:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzctkPeI1EzYCBs1K1eeOqYtwG8NAm0HLE5poA8LT0MWExgcuMH8q9csbH02iGOuME2RGSW X-Received: by 2002:a17:906:f246:: with SMTP id gy6mr7924880ejb.264.1611781089099; Wed, 27 Jan 2021 12:58:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611781089; cv=none; d=google.com; s=arc-20160816; b=s1BGZQ901G2wuuFVC+PW4c0G7dcAF/mMkBCXaNpY8cuVmiQXjfWCjT8hDkV8C2Yj7F BwndNaEenxiNDevuzndCvNZ20LO6zVUK00hJdrc81k/kGM4b+1xw1EZTPtO9QOhdVMhO qgM4wKIHUKZIYSo+6z1zPgssKiX1NTVYO12WP5bE5X10IPOmzP8N9bEhrCHIgkiQjGAL p4yQy0KEUfz3pPae/mgDbiz7heU8hQusUiObNEiyyPp1uSMe7CNjiZHveannSEj7TjF0 3tk7DzjHjzS0Dxr8ZFTX7Y7Mjt1rA1iq+pe68hvpxzAD7Afr1wvzDxtx0KkfdVzrAS/J WdWQ== 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=KInmekppXEkYTPkrUjL8o9RUj8TT2e5M46gGzwoDGjQ=; b=VsxeywZCejWwtFMmS00n1WY7ooTJbxjFCvlHQ9fBkSrQ+gdGKhKASuEuEQdgFV1fiZ UZc34mY+pRtr71jPYNqb439uQm+9Uf+uPbhbHtOI7X9p+h1YCF5J5onhkOFd7vbiMZ0u MBIirk52hbEccPOSYSpfvuJaQcyEy7WWmMtSI14vxnzETlVFt5tgkX0psXFoB0VrQNbW n2kpeb0iFNOkfuDRFWJueebg3jCdsCnNn2Bx9chMpardLeQYZ8YCdVx2SuZHImmuPpgW /s3p0bGb22FcoLBd+f+/Ems1w1YQvpbxEsaVEZqXeCTEoHA+4uYpko/hNqykRXoUKQMY IT1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="hSF/WDFx"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id la19si1288253ejc.445.2021.01.27.12.57.43; Wed, 27 Jan 2021 12:58:09 -0800 (PST) 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=@infradead.org header.s=casper.20170209 header.b="hSF/WDFx"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238000AbhA0EDc (ORCPT + 99 others); Tue, 26 Jan 2021 23:03:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232103AbhA0DCm (ORCPT ); Tue, 26 Jan 2021 22:02:42 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED296C061788; Tue, 26 Jan 2021 19:01:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=KInmekppXEkYTPkrUjL8o9RUj8TT2e5M46gGzwoDGjQ=; b=hSF/WDFxslXz5B1CInRT4vI+g0 c047ULVTL+DpBc9p8nMfkZcwdcZjsLy4nAZrdmmyjsyycw2ycuvWRqu4Il/Vyjgz5Qb/APv7H5WBI amjhcuwn3hZUi6aVlMViCUIarFns3Z7vm0tJvJCsEI5ld4Of/y9Sk/EaBmZMUzM8LjnerN5ulLbcI 4vX8h8f2/AfEqj/FlKySh5QJQXyAPrv/4JVnJRvjwJs0DEfgPGXA32JGm44+DZ6w7ByllS2v5EfzI aVc4VpIiZW2scWlTRQcaJ6Fdsvc1UpZb/Y2uHpSm1mzLOYn9Xs6QIrQ0kCjxpS4uesY0jmItitDiY iKSDB6EQ==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1l4b3C-006YDA-SR; Wed, 27 Jan 2021 02:59:31 +0000 Date: Wed, 27 Jan 2021 02:59:22 +0000 From: Matthew Wilcox To: Minchan Kim Cc: Chris Goldsworthy , viro@zeniv.linux.org.uk, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Laura Abbott Subject: Re: [PATCH v4] fs/buffer.c: Revoke LRU when trying to drop buffers Message-ID: <20210127025922.GS308988@casper.infradead.org> 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 On Tue, Jan 26, 2021 at 02:59:17PM -0800, Minchan Kim wrote: > The release buffer_head in LRU is great improvement for migration > point of view. > > A question: > > Can't we invalidate(e.g., invalidate_bh_lrus) bh_lru in migrate_prep or > elsewhere when migration found the failure and is about to retry? > > Migration has done such a way for other per-cpu stuffs for a long time, > which would be more consistent with others and might be faster sometimes > with reducing IPI calls for page. Should lru_add_drain_all() also handle draining the buffer lru for all callers? A quick survey ... invalidate_bdev() already calls invalidate_bh_lrus() compact_nodes() would probably benefit from the BH LRU being invalidated POSIX_FADV_DONTNEED would benefit if the underlying filesystem uses BHs check_and_migrate_cma_pages() would benefit khugepaged_do_scan() doesn't need it today scan_get_next_rmap_item() looks like it only works on anon pages (?) so doesn't need it mem_cgroup_force_empty() probably needs it mem_cgroup_move_charge() ditto memfd_wait_for_pins() doesn't need it shake_page() might benefit offline_pages() would benefit alloc_contig_range() would benefit Seems like most would benefit and a few won't care. I think I'd lean towards having lru_add_drain_all() call invalidate_bh_lrus(), just to simplify things.