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] [day] [month] [year] [list]
Message-ID: <49F6CEF5.5090203@panasas.com>
Date:	Tue, 28 Apr 2009 12:40:05 +0300
From:	Boaz Harrosh <bharrosh@...asas.com>
To:	Jens Axboe <jens.axboe@...cle.com>
CC:	Jeff Garzik <jeff@...zik.org>, LKML <linux-kernel@...r.kernel.org>,
	linux-scsi@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	James.Bottomley@...senPartnership.com, osd-dev@...n-osd.org,
	Tejun Heo <tj@...nel.org>
Subject: Re: [PATCH 3/3 v3] osdblk: a Linux block device for OSD objects

On 04/27/2009 09:24 PM, Jens Axboe wrote:
> On Mon, Apr 27 2009, Boaz Harrosh wrote:

Jens Hi, Thanks for your reply. Please I need some help with
this.

>>> +static struct bio *bio_chain_clone(struct bio *old_chain, gfp_t gfpmask)
>>> +{
>>> +	struct bio *tmp, *new_chain = NULL, *tail = NULL;
>>> +
>>> +	while (old_chain) {
>>> +		tmp = bio_clone(old_chain, gfpmask);
>>> +		if (!tmp)
>>> +			goto err_out;
>>> +
>>> +		tmp->bi_next = NULL;
>>> +		if (!new_chain)
>>> +			new_chain = tail = tmp;
>>> +		else {
>>> +			tail->bi_next = tmp;
>>> +			tail = tmp;
>>> +		}
>>> +
>>> +		old_chain = old_chain->bi_next;
>>> +	}
>>> +
>>> +	return new_chain;
>>> +
>>> +err_out:
>>> +	bio_chain_put(new_chain);
>>> +	return NULL;
>>> +}
>>> +
>> NOTE-TO-ME:
>>   blk_bio_clone()
> 
> Note to Boaz - this is illegal, unless gfp_mask is GFP_ATOMIC (in which
> case you should not pass it in). 

OK it is only used with GFP_ATOMIC.
Theoretically, what if I use a thread and am aloud to sleep,
(and executing requests in serial). Can I then wait on the first bio_clone.

> The only way to make this work is to:
> 

Are you saying that, in the case I'm a swap device? or do you mean that if I
use the above code I can break it for other devices that are swap-devices
and cause a live lock for them.

Currently the OSD library is not swap safe. And even if it was, iSCSI is not.
So there is no option of this ever been swap.

> 1) Have a private bio pool, and

Do I need to manage such a pool internally and use __bio_clone() or is there
an easy way to associate a private bio-pool to a request_queue?

> 2) Make sure it has enough reserved entries to populate the chain

Is there a system limit to that, that I can be sure of? Or just choose
a magic number and if it is exceeded just split the io up in parts?

> 3) Ensure only a single caller at the time, or entries enough for the N
>    users that are allowed. It has to be controlled either way, whether N
>    is 1 or larger.

osdblk_rq_fn (the queue fn) is it serialized to one thread? If not
could I use the queue lock for the duration of the clone?

> 

Thanks for your help
Boaz
--
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