Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp797162ybz; Wed, 22 Apr 2020 08:10:37 -0700 (PDT) X-Google-Smtp-Source: APiQypKgOVmSrSN5Do2p1LsuvV+Ykt/63SIi/JPVHU1cFlKyA7ueli7/H9ticQwmWEeUITxpc5n7 X-Received: by 2002:a05:6402:b47:: with SMTP id bx7mr22727105edb.374.1587568237555; Wed, 22 Apr 2020 08:10:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587568237; cv=none; d=google.com; s=arc-20160816; b=PvuJROMvVyK4L4DKP0U+THS6pa8nTTrxKzdiSY64qfKmmer27yiFqwIFxnSKOborQL 9PxZxXDeKN89F3lQB6o6qFs55w5vMI3tIcnmKUwIpTfrZLWwY733zpEuiuxyEzoh+0Zc /QEX/+pDRsMs2bBH9fBTSiD0Q5zmE94J0FVhXB1XKBkSvGVURIbUrk69RHT+anPzIWr4 Q6siWgA58xG+wuW/A1nmN2oyu5ZHr0yJPpz3ie34pqtgepdo13t6WjaoT6dfTlL3gxZE oc0L0biCZ1g1aIGR3wlIbsdKPnfFDiQKpudaa3PKf5sgKgEhzIypWc+XZBCGfaKwZu7D ZuOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=ECHfBYvijtJGhVBLubDZ4q+i8meIlAmwJZvdPczUr+w=; b=JJtrhQHTMyQnrtF2ZkwXQodZm1WrmfWGK+zP3QvCgqjs3WihgkUgkpGQdFC4GIgker yCWVNkAh5OAbF+pbkUczYS++5X3gElH38uvZDiEBCH0C/ms9zhlBIhYc5u4Rd5HjYiUa lVzjiewWPPzNItZXwkUzNNvWB+HoC60MY9xFR16wVO7gMCs1ra/q0n4oXOhosD2NT/QM +KCJBtbifj3VM0bHRgLyIFkB15Cm3jyD7TfBQ3Aa0gACZ1fgJjw8hn2qhrjKLgvn7Xw+ aT+0Ogz27Hyr5EdCeSZdpG1EAJffbYl19t17konQOgxRnv+CPjyQrLnydyFYWkk36iFB Czhg== ARC-Authentication-Results: i=1; mx.google.com; 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 v22si3533644eds.78.2020.04.22.08.10.00; Wed, 22 Apr 2020 08:10:37 -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; 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 S1728104AbgDVPDH (ORCPT + 99 others); Wed, 22 Apr 2020 11:03:07 -0400 Received: from mx2.suse.de ([195.135.220.15]:57988 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726023AbgDVPDF (ORCPT ); Wed, 22 Apr 2020 11:03:05 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 189F3AD39; Wed, 22 Apr 2020 15:03:03 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 54CCA1E0E56; Wed, 22 Apr 2020 17:03:03 +0200 (CEST) From: Jan Kara To: Matthew Wilcox Cc: , LKML , Jan Kara Subject: [PATCH 0/23 v2] mm: Speedup page cache truncation Date: Wed, 22 Apr 2020 17:02:33 +0200 Message-Id: <20200422150256.23473-1-jack@suse.cz> X-Mailer: git-send-email 2.16.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, this is a second version of my patches to avoid clearing marks from xas_store() and thus fix regression in page cache truncation. Changes since v1 - rebased on 5.7-rc2 - drop xas_for_each_marked() fix as it was already merged - reworked the whole series based on Matthew's feedback - we now create new function xas_store_noinit() and use it instead of changing xas_store() behavior. Note that for xas_store_range() and __xa_cmpxchg() I didn't bother to change names although they stop clearing marks as well. This is because there are only very few callers so it's easy to verify them, also chances of a clash with other patch introducing new callers are very small. Original motivation: Conversion of page cache to xarray (commit 69b6c1319b6 "mm: Convert truncate to XArray" in particular) has regressed performance of page cache truncation by about 10% (see my original report here [1]). This patch series aims at improving the truncation to get some of that regression back. The first patch fixes a long standing bug with xas_for_each_marked() that I've uncovered when debugging my patches. The remaining patches then work towards the ability to stop clearing marks in xas_store() which improves truncation performance by about 6%. The patches have passed radix_tree tests in tools/testing and also fstests runs for ext4 & xfs. Honza [1] https://lore.kernel.org/linux-mm/20190226165628.GB24711@quack2.suse.cz