From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754392AbbCLMY0 (ORCPT ); Thu, 12 Mar 2015 08:24:26 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:21168 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754164AbbCLMYV (ORCPT ); Thu, 12 Mar 2015 08:24:21 -0400 Message-ID: <55018569.9080908@fb.com> Date: Thu, 12 Mar 2015 08:24:09 -0400 From: Josef Bacik User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Al Viro CC: , , , , Dave Chinner Subject: Re: [PATCH 2/9] inode: add IOP_NOTHASHED to avoid inode hash lock in evict References: <1426016724-23912-1-git-send-email-jbacik@fb.com> <1426016724-23912-3-git-send-email-jbacik@fb.com> <20150312095206.GM29656@ZenIV.linux.org.uk> In-Reply-To: <20150312095206.GM29656@ZenIV.linux.org.uk> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.54.13] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-03-12_04:2015-03-12,2015-03-12,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1503120123 X-FB-Internal: deliver Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/12/2015 05:52 AM, Al Viro wrote: > On Tue, Mar 10, 2015 at 03:45:17PM -0400, Josef Bacik wrote: >> From: Dave Chinner >> >> Some filesystems don't use the VFS inode hash and fake the fact they >> are hashed so that all the writeback code works correctly. However, >> this means the evict() path still tries to remove the inode from the >> hash, meaning that the inode_hash_lock() needs to be taken >> unnecessarily. Hence under certain workloads the inode_hash_lock can >> be contended even if the inode is never actually hashed. >> >> To avoid this, add an inode opflag to allow inode_hash_remove() to >> avoid taking the hash lock on inodes have never actually been >> hashed. > > Why bother with flags, etc. when we could just do > > static inline bool hlist_fake(struct hlist_node *h) > { > return h->pprev == &h->next; > } > >> - if (!inode_unhashed(inode)) >> + if (!((inode->i_opflags & IOP_NOTHASHED) || inode_unhashed(inode))) > > and turn this check into > if (!inode_unhashed(inode) && !hlist_fake(&inode->i_hash)) > > instead? > I made the change and sent the new patch, hopefully it worked, sometimes my laptop screws up git-send-email. If everything looks good to you Al you can pull from my tree if you don't want to scrape from the list git://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git superblock-scaling Thanks, Josef