lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 27 Oct 2010 05:05:30 -0400
From:	Christoph Hellwig <hch@...radead.org>
To:	Dave Chinner <david@...morbit.com>
Cc:	viro@...IV.linux.org.uk, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/4] fs: Lock the inode LRU list separately

> @@ -30,10 +30,13 @@
>   *
>   * inode->i_lock protects:
>   *   i_state
> + * inode_lru_lock protects:
> + *   inode_lru, i_lru
>   *
>   * Lock ordering:
>   * inode_lock
>   *   inode->i_lock
> + *     inode_lru_lock
>   */

Always writing the inode fields as inode->i_foo might be better.

> @@ -537,15 +545,10 @@ void evict_inodes(struct super_block *sb)
>  		}
>  
>  		inode->i_state |= I_FREEING;
> -		if (!(inode->i_state & (I_DIRTY | I_SYNC)))
> -			percpu_counter_dec(&nr_inodes_unused);
> +		inode_lru_list_del(inode);
>  		spin_unlock(&inode->i_lock);
>  
> -		/*
> -		 * Move the inode off the IO lists and LRU once I_FREEING is
> -		 * set so that it won't get moved back on there if it is dirty.
> -		 */
> -		list_move(&inode->i_lru, &dispose);
> +		list_add(&inode->i_lru, &dispose);
>  	}
>  	spin_unlock(&inode_lock);
>  
> @@ -582,15 +585,10 @@ int invalidate_inodes(struct super_block *sb)
>  		}
>  
>  		inode->i_state |= I_FREEING;
> -		if (!(inode->i_state & (I_DIRTY | I_SYNC)))
> -			percpu_counter_dec(&nr_inodes_unused);
> +		inode_lru_list_del(inode);
>  		spin_unlock(&inode->i_lock);

with this scheme we now decrement nr_inodes_unused twice - once in
invalidate_inodes/evict_inodes and once in dispose_one_inode.  I think
you just want to use an opencoded list_move under the lru lock to
move the inode to the temporary list for now, similar to what
prune_icache does.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ