Received: by 10.223.185.116 with SMTP id b49csp3749492wrg; Mon, 19 Feb 2018 05:27:44 -0800 (PST) X-Google-Smtp-Source: AH8x226UoR+vR1p8kepPnZKqsJt6LWJyw2mNg9nSv2vgdnjklW8kcyzDI8Syv0/VbCA0t9UfTzhZ X-Received: by 10.98.8.141 with SMTP id 13mr14684580pfi.213.1519046864006; Mon, 19 Feb 2018 05:27:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519046863; cv=none; d=google.com; s=arc-20160816; b=mso6VPT8bn9ruzZuhyHl5jUuOW7Na2m+XksetuoYRBeIX/7JFAi4cN446xaDQRU9nk MYPPc+7GNL1V1AZicDbZ4JeJkAQ+gj6B7Mrs8V3PIYcWu7dJwcRzmRfxwgcVWdh4INgA XP8az6vlEcVSeOhugLesa02JSCKFPgX+9liOWsMYiKoTOP95XH8f7mCAnpMUbynoLC4J 4v9P0ryx14+IwBze5lbZWW3B4h0kzl2dENdhwUnWM0OwLSZnhWoI7Q7NnFR3+dEL150H DkbzrmTWfVsNgfcAshE7MNT4y/G4wA3cEtl4oDLFWZTxBOtQCUaa5Bx5dbo0aXl891Xo AHNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :mime-version:user-agent:date:message-id:cc:to:subject:from :dkim-signature:arc-authentication-results; bh=Q6GpJ6VLOLAIHPixdJuwIMVnwn6gfljXACR5AXJCmLA=; b=QDZcHklMIe5cJ4wVnVVxtT+h8Ukx5/4KR2dsmtfecr1KQ1KAgyP/6ETKMvrWIfALwG Fmln/UEG98xASWgKZk+Wapa8cOc8eGrt4yJX2hrX7pXtCCQogENz0s2Eq4hGRvw07bzD r1YkBD0ftf6a1zmQMTjXdDrAjZJqq+B8l1k/E5gQWeOJACnCJ65pa8H6YS4ShVzhcTUm BOE0wfhwRj8sKp0xB9bZOotlGGV8v9lOS7h3kXzVO76bduQng/ai/sNbaWC0cT1a+8qK B+I94C71Ojcn+3orGiYXnZKjjrcdjZTxqwWQ7kv5DFhPBmeH+m7Fv5cO8yS45m9arfC9 8biQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nokia.onmicrosoft.com header.s=selector1-nokia-com header.b=c++gbC/n; 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=nokia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1-v6si7709543pli.534.2018.02.19.05.27.29; Mon, 19 Feb 2018 05:27:43 -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=@nokia.onmicrosoft.com header.s=selector1-nokia-com header.b=c++gbC/n; 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=nokia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752813AbeBSN0s (ORCPT + 99 others); Mon, 19 Feb 2018 08:26:48 -0500 Received: from mail-he1eur01on0131.outbound.protection.outlook.com ([104.47.0.131]:44496 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752737AbeBSN0q (ORCPT ); Mon, 19 Feb 2018 08:26:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Q6GpJ6VLOLAIHPixdJuwIMVnwn6gfljXACR5AXJCmLA=; b=c++gbC/noOnpxJwlo1pzfiu0viHdExUqxbK7+B30feKrzIxlTccxkJjnqJjCnbIm+4m+KCSLvFXuC/w4mexu6EtKdz+xky+aL4y/aYnPIdDTKwIt/i7XbcyP9wI7RwMOzq8OdWPIk4Hl+qF6L1FX9/0SHOJnniZX1MS+TkOcTyE= Received: from [10.145.143.144] (131.228.32.176) by AM4PR07MB1313.eurprd07.prod.outlook.com (2a01:111:e400:59ec::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.527.6; Mon, 19 Feb 2018 13:26:42 +0000 From: Tommi Rantala Subject: backporting "ext4: inplace xattr block update fails to deduplicate blocks" to LTS kernels? To: Tahsin Erdogan , Theodore Ts'o , Andreas Dilger Cc: linux-ext4@vger.kernel.org, LKML , Greg Kroah-Hartman Message-ID: Date: Mon, 19 Feb 2018 15:26:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [131.228.32.176] X-ClientProxiedBy: HE1PR09CA0056.eurprd09.prod.outlook.com (2603:10a6:7:3c::24) To AM4PR07MB1313.eurprd07.prod.outlook.com (2a01:111:e400:59ec::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 50c20d58-acec-4273-8f1c-08d5779c6af5 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7193020);SRVR:AM4PR07MB1313; X-Microsoft-Exchange-Diagnostics: 1;AM4PR07MB1313;3:pQ0W9zTTSzV6aWxR1r9URR8LGR4PvyGqZgMC4GWDBiwPDteWnfGdk5nYhvGa6nweWGPFKH2qAY0RWarRV6m6yHyPb9bObuI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FzZxViuUJFKKj3B7jeHwByHPkuVEgua5a4XY36mvyln9jFNjZYk3PGSFi3QEN+sx7VGUi6v1DUhbVWLIJDRW2RqSTGiKDcBXnnUKji2V0K08C4YsiiTEFrYEVmxmJ/CdXPA9mB1KGnpGaJYqG6EEi+wbZbncg3cW+kbDew2f8p6b3tSDj8bAy8Opodwj1XHveacpbXMckAqrRWwvjFp1UjW3dtZVJsx2wN5y+etRrz1;4:yt1qnUgJ0l+6eYAnqzFI1RHKXJD9uGDRSo0y6xdqd2KN73DmuutO+pn/i9gRHiPONGM/H+gD91dCaZiTC5CAv5G6abO2xD/VqWTujwEyFezX5bNcHHC+a7ts+B3cLnZSjB8RVjAbGgEOFfQcq20qbI4QWG1I+HM8bWDYHwElHh6GMwdtpUCuEE7nDOm24ZCukUiGTKs4kN9q3qnSkb42G6JebpJnMxNADWjqX5AIjcj56peSRiavkc7WwS7IN74wl4XMPnKE8zU+IXO3N6M/wkdQTKtEZGPOQ2fhSsTO1aI8I2dunQo9BTbHNlzVuw3OtqnqJIlAoFUsMR9YlH766Dmdg06YFmLU8RK6//RYfgE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(211936372134217)(153496737603132); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040501)(2401047)(8121501046)(5005006)(3231101)(11241501184)(806099)(944501161)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041288)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(6072148)(201708071742011);SRVR:AM4PR07MB1313;BCL:0;PCL:0;RULEID:;SRVR:AM4PR07MB1313; X-Forefront-PRVS: 0588B2BD96 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6049001)(366004)(376002)(346002)(39860400002)(39380400002)(396003)(189003)(199004)(4326008)(66066001)(65956001)(68736007)(7736002)(26005)(77096007)(6346003)(47776003)(2906002)(25786009)(106356001)(6486002)(15650500001)(105586002)(23676004)(2486003)(16526019)(52116002)(52146003)(36756003)(186003)(6116002)(3846002)(5660300001)(2171002)(8936002)(50466002)(230700001)(386003)(83506002)(478600001)(6666003)(316002)(65826007)(97736004)(16576012)(58126008)(81166006)(81156014)(110136005)(53936002)(64126003)(305945005)(65806001)(8676002)(31696002)(54906003)(59450400001)(31686004)(67846002)(86362001)(575784001);DIR:OUT;SFP:1102;SCL:1;SRVR:AM4PR07MB1313;H:[10.145.143.144];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: nokia.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=tommi.t.rantala@nokia.com; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTRQUjA3TUIxMzEzOzIzOjh1UnFySzFGWWxiZE1FY0RHaDBhS2RGd1BW?= =?utf-8?B?bEVQV29NSjZCVEl5MzhPWnM0U2wwd0NYdnFYZlE0eUNyTklmb0ptZ3NpOGlD?= =?utf-8?B?WXNYTFVxVG9tYjkwNUpaN3lESDlxYzdhRnJhbnV5MWJtazQrODVMMFlkTEhl?= =?utf-8?B?TWFPaytBZ0ZDRlByVkY2WFhzR0dwcTlkNEtEeDdOSmRaUW9qWVEwK0xDRSs1?= =?utf-8?B?djJVVHNlR0Q5emxacHA1SjdpZlh2SVdROTBLS3VLV1RoSW1EUXFqZXNnSFdr?= =?utf-8?B?dEtDZWFJTWdiNHNYakdxVnhqelNaRWp5NytsejFZb0ZlK1F6ZUlLc0FpeEI2?= =?utf-8?B?ZFUrSEQrMUx6SW0zenVGSy81VDNnbm8xQzZmdmE5R25xeXJjWDFvYitlWkNi?= =?utf-8?B?eTliU25MKzBaUFR1STY5WWNrZFBFUUdQK3Z0azM4VXhIb3NvejRnQ0pLLzFh?= =?utf-8?B?TnJFZktnRG9ISnQ4VndQbnJESG0vQXhxaE1CQjM1MWlvZDh0L2EvZVUxSTdl?= =?utf-8?B?RTFaTnBXa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Z5Ru1Qv5YM24DAOSQU/1qS047M1f+2XqgWp7zG2HX4+G93A94pIslS8K7PfVrpGO/p6fK8ipWvt8kyAiUuqKhJmrHhoANERJxniriQ9xBZXBkF/5Z/42p9RrHEC/BNHEB+tG37Rdjs1Jxs4H8iGOUVI=;24:WJrKLhey4+RZPjB5oNX2d2ndZAN7O4y7CNvrUrba67AfUg4dAJooj/jGa9G95EEx4ZMBZ8caiW0SxhWWt7X1BRUYVqXmKVpNZRaBXb8PPto=;7:GSRMrG1hIMD/feCQrZwRZHmVmTrEMyRxz3rALjJCFtBpizDf6sTm5E5uQL4cUhR+eNweWfus7PW+vOGFZuBLssrQci9sx+0p/7u1tgGUbWcR18SADK6x7SFwUwyd9LH89KHQJbNwBthDN1pKSej2fAnfIcgCJndiprmYdSJw6SJsFC/7alnPGiPoRJNteVLSItBHI8xe7tkG1LOzASB+LzzFhbKp49oONZstXElc9FivtJoAWrP9CFJg4vYgD75n SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2018 13:26:42.2143 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 50c20d58-acec-4273-8f1c-08d5779c6af5 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR07MB1313 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, 4.9 (and earlier) LTS kernels are missing this: commit ec00022030da5761518476096626338bd67df57a Author: Tahsin Erdogan Date: Sat Aug 5 22:41:42 2017 -0400 ext4: inplace xattr block update fails to deduplicate blocks OK to backport it? I tested it briefly in 4.9, seems to work. One of our testers noticed a glusterfs performance regression when going from 4.4 to 4.9, caused by the duplicated blocks. In I understand everything correctly, in 4.4 mbcache uses the block number in the hash table bucket calculation, and the hash table is populated quite evenly even if there are duplicates. So the mbcache is fast. But in later kernels mbcache puts all the duplicate entries into a single bucket. As the entries are stored in one big linked list, this obviously makes the mbcache slow. I tested this in 4.9 (which still has the ext4_xattr_rehash() call that got eliminated in commit "ext4: eliminate xattr entry e_hash recalculation for removes"): diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 3eeed8f0aa06..3fadfabcac39 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -837,8 +837,6 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode, if (!IS_LAST_ENTRY(s->first)) ext4_xattr_rehash(header(s->base), s->here); - ext4_xattr_cache_insert(ext4_mb_cache, - bs->bh); } ext4_xattr_block_csum_set(inode, bs->bh); unlock_buffer(bs->bh); @@ -959,6 +957,7 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode, } else if (bs->bh && s->base == bs->bh->b_data) { /* We were modifying this block in-place. */ ea_bdebug(bs->bh, "keeping this block"); + ext4_xattr_cache_insert(ext4_mb_cache, bs->bh); new_bh = bs->bh; get_bh(new_bh); } else { Tommi