From patchwork Mon Nov 20 15:05:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Dobriyan X-Patchwork-Id: 10066679 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A80A9602B7 for ; Mon, 20 Nov 2017 15:05:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96D9E28F5C for ; Mon, 20 Nov 2017 15:05:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89D7C28F59; Mon, 20 Nov 2017 15:05:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 312C228F59 for ; Mon, 20 Nov 2017 15:05:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751313AbdKTPFN (ORCPT ); Mon, 20 Nov 2017 10:05:13 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:46963 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751309AbdKTPFM (ORCPT ); Mon, 20 Nov 2017 10:05:12 -0500 Received: by mail-wr0-f194.google.com with SMTP id r2so1901714wra.13 for ; Mon, 20 Nov 2017 07:05:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=O61ointJ+yzEEgIqG6yvMVx1otOsE6mR0GgXiBjQdtI=; b=FDSquUnx9EvHvCj1+pOzSpuxMvdEZBAWzi1bCUq16LwxyINsyX4Ozl6HVJA5DaAdv9 AMreryAtP7CJkGR5JmooE1JZQCW4d84S5qtEDGauQMEF38AASMHpjv6Rd1XdeaKCowMJ qjIk1hGPDe+sE/3LicK951UaMynCX4ai8kbshkv/jxtwg5u2OCybtCChBxzZYX9gBRN/ h/F5u1t8p/Qj5as+vPnyybVNzItIozqkn/c57R11ZggRElTodrh6rpzIKumndjEW23bz rAI28RQ7Ba79i1rQMEAjZ6veVDTDExCzfq87mc9A4JI2UyjYhWygasECWXRDEVUK904J EYnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=O61ointJ+yzEEgIqG6yvMVx1otOsE6mR0GgXiBjQdtI=; b=Jqb9dCx7AkOWWJqYfDpsILmUc1QdG7w/sMaYlf+wnt1ZN7WDvruLvZ9ZmeT4LpAUXd 63uTloK1rR/Pi+c4Vq+N8bpSbIT3QUzgY1AI2/xJ/zIFt/TlFU94VNI9Wd4znwYqqhEL zL2P3iyba9sFRdnetGyNjYm5oSZt830QY3/TJOugJSWO/oc3Hhs2uc4qgZUKk4PI4gsX xz+jvbWvIqLfCgXBRNpul2p51XOBXMYSUiMvI5QPEtWNvqinULfkZNrWG5nW3f31606w kmCIcKlYj4yXJn0UJfUrEpN/nJJi8b1PcIYiaLjb2BWMLtuOZ4sRnAl4OxO9W3GuNOAw m6Jg== X-Gm-Message-State: AJaThX5OVwyKHXmjQsQslundOmDv3TQ+ZAoTgINhvowco/uab0syTVOD ZjbGBC2liCnKlKLwhjn+rAbg X-Google-Smtp-Source: AGs4zMaOi8VVRFJdi+x1cWNMzkkaCLzJjtQUvHq0niTtJW/uP0JFkp4iuN8/nCHmwxbZM/4RgjaVHg== X-Received: by 10.223.186.9 with SMTP id o9mr2599450wrg.221.1511190311161; Mon, 20 Nov 2017 07:05:11 -0800 (PST) Received: from avx2 (nat4-minsk-pool-46-53-177-92.telecom.by. [46.53.177.92]) by smtp.gmail.com with ESMTPSA id 138sm13305797wmf.21.2017.11.20.07.05.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 07:05:10 -0800 (PST) Date: Mon, 20 Nov 2017 18:05:07 +0300 From: Alexey Dobriyan To: viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org Subject: [PATCH 1/2] dcache: subtract d_hash_shift from 32 in advance Message-ID: <20171120150507.GA5832@avx2> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Alexey Dobriyan --- fs/dcache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/dcache.c +++ b/fs/dcache.c @@ -111,7 +111,7 @@ static struct hlist_bl_head *dentry_hashtable __read_mostly; static inline struct hlist_bl_head *d_hash(unsigned int hash) { - return dentry_hashtable + (hash >> (32 - d_hash_shift)); + return dentry_hashtable + (hash >> d_hash_shift); } #define IN_LOOKUP_SHIFT 10 @@ -3592,6 +3592,7 @@ static void __init dcache_init_early(void) &d_hash_mask, 0, 0); + d_hash_shift = 32 - d_hash_shift; } static void __init dcache_init(void) @@ -3618,6 +3619,7 @@ static void __init dcache_init(void) &d_hash_mask, 0, 0); + d_hash_shift = 32 - d_hash_shift; } /* SLAB cache for __getname() consumers */