Re: collapse concurrent forced allocations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Feb 22, 2013, Josef Bacik <jbacik@xxxxxxxxxxxx> wrote:

> So I understand what you are getting at, but I think you are doing it wrong.  If
> we're calling with CHUNK_ALLOC_FORCE, but somebody has already started to
> allocate with CHUNK_ALLOC_NO_FORCE, we'll reset the space_info->force_alloc to
> our original caller's CHUNK_ALLOC_FORCE.

But that's ok, do_chunk_alloc will set space_info->force_alloc to
CHUNK_ALLOC_NO_FORCE at the end, when it succeeds allocating, and then
anyone else waiting on the mutex to try to allocate will load the
NO_FORCE from space_info.

> So we only really care about making sure a chunk is actually
> allocated, instead of doing this flag shuffling we should just do

> if (space_info->chunk_alloc) {
> 	spin_unlock(&space_info->lock);
> 	wait_event(!space_info->chunk_alloc);
> 	return 0;
> }

Sorry, I don't follow.

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux