On Thu, Aug 28, 2014 at 06:04:55PM -0400, Vasily Tarasov wrote: [..] > +#include "dm-dedup-target.h" > +#include "dm-dedup-hash.h" > +#include <linux/atomic.h> > +#include <linux/blk_types.h> > + > +/* > + * We are declaring and initalizaing global hash_desc, because > + * we need to do hash computation in endio function, and this > + * function is called in softirq context. Hence we are not > + * allowed to perform any operation on that path which can sleep. > + * And tfm allocation in hash_desc, at one point, tries to take > + * semaphore and hence tries to sleep. And because of this we get > + * BUG, which complains "Scheduling while atomic". Hence to avoid > + * this scenario, we moved the declaration and initialization out > + * of critical path. > + */ Hi, Is this comment still valid? We calculate hash when bio is submitted from the worker thread context. So where is the softirq context here? do_work() process_bio() handle_write() compute_hash_bio() This all is happening in worker worker thread context and not softirq context? Thanks Vivek -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel