On Wed, Sep 03, 2014 at 04:00:39PM -0400, Theodore Ts'o wrote: > On Wed, Sep 03, 2014 at 05:31:22PM +0200, Jan Kara wrote: > > Also one question: > > > > > - if (ei == locked_ei || !write_trylock(&ei->i_es_lock)) { > > > - nr_skipped++; > > > - spin_lock(&sbi->s_es_lock); > > > __ext4_es_list_add(sbi, ei); > > > + if (spin_is_contended(&sbi->s_es_lock)) { > > > + spin_unlock(&sbi->s_es_lock); > > > + spin_lock(&sbi->s_es_lock); > > > + } > > Why not cond_resched_lock(&sbi->s_es_lock)? > > I didn't think we were allowed to reschedule or sleep while in > shrinker context? You are allowed to block shrinkers if there is no possibility of deadlock. i.e. that's what the __GFP_FS flag check in filesystem shrinkers is for - so that they only run in GFP_KERNEL context and not GFP_NOFS/GFP_NOIO/GFP_ATOMIC context where blocking reclaim can cause deadlocks... Cheers, Dave. -- Dave Chinner david@xxxxxxxxxxxxx -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html