All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Liu <jeff.liu@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] run out of jbd2 credits during discontig group alloc.
Date: Mon, 03 Dec 2012 16:33:17 +0800	[thread overview]
Message-ID: <50BC63CD.8020905@oracle.com> (raw)
In-Reply-To: <50BC376E.3070402@oracle.com>

Hi Xiaowei,

Could you supply the crash info as well as your test scenario?

Thanks,
-Jeff
On 12/03/2012 01:23 PM, Xiaowei wrote:
> Could someone review this patch please? it's verified one testing box , 
> fixed the run out of credits crash.
> 
> Thanks,
> Xiaowei
> 
> 
> On 11/15/2012 09:20 AM, xiaowei.hu at oracle.com wrote:
>> From: "Xiaowei.Hu" <xiaowei.hu@oracle.com>
>>
>> ocfs2_block_group_alloc_discontig doesn't keep credits for chain relink,
>> and mean to disable chain relink setting ac->ac_allow_chain_relink = 0,
>> but this value will be set to 1 in function ocfs2_claim_suballoc_bits,
>> so need to make it's default allow relink, and disable it with one
>> switch could be passed in.
>>
>> Signed-off-by: Xiaowei.Hu <xiaowei.hu@oracle.com>
>> ---
>>   fs/ocfs2/suballoc.c |    7 +++----
>>   fs/ocfs2/suballoc.h |    2 +-
>>   2 files changed, 4 insertions(+), 5 deletions(-)
>>
>> diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c
>> index 4b5e568..033bfc6 100644
>> --- a/fs/ocfs2/suballoc.c
>> +++ b/fs/ocfs2/suballoc.c
>> @@ -642,7 +642,7 @@ ocfs2_block_group_alloc_discontig(handle_t *handle,
>>   	 * cluster groups will be staying in cache for the duration of
>>   	 * this operation.
>>   	 */
>> -	ac->ac_allow_chain_relink = 0;
>> +	ac->ac_disable_chain_relink = 1;
>>   
>>   	/* Claim the first region */
>>   	status = ocfs2_block_group_claim_bits(osb, handle, ac, min_bits,
>> @@ -1823,7 +1823,7 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
>>   	 * Do this *after* figuring out how many bits we're taking out
>>   	 * of our target group.
>>   	 */
>> -	if (ac->ac_allow_chain_relink &&
>> +	if (!ac->ac_disable_chain_relink &&
>>   	    (prev_group_bh) &&
>>   	    (ocfs2_block_group_reasonably_empty(bg, res->sr_bits))) {
>>   		status = ocfs2_relink_block_group(handle, alloc_inode,
>> @@ -1928,7 +1928,6 @@ static int ocfs2_claim_suballoc_bits(struct ocfs2_alloc_context *ac,
>>   
>>   	victim = ocfs2_find_victim_chain(cl);
>>   	ac->ac_chain = victim;
>> -	ac->ac_allow_chain_relink = 1;
>>   
>>   	status = ocfs2_search_chain(ac, handle, bits_wanted, min_bits,
>>   				    res, &bits_left);
>> @@ -1947,7 +1946,7 @@ static int ocfs2_claim_suballoc_bits(struct ocfs2_alloc_context *ac,
>>   	 * searching each chain in order. Don't allow chain relinking
>>   	 * because we only calculate enough journal credits for one
>>   	 * relink per alloc. */
>> -	ac->ac_allow_chain_relink = 0;
>> +	ac->ac_disable_chain_relink = 1;
>>   	for (i = 0; i < le16_to_cpu(cl->cl_next_free_rec); i ++) {
>>   		if (i == victim)
>>   			continue;
>> diff --git a/fs/ocfs2/suballoc.h b/fs/ocfs2/suballoc.h
>> index b8afabf..a36d0aa 100644
>> --- a/fs/ocfs2/suballoc.h
>> +++ b/fs/ocfs2/suballoc.h
>> @@ -49,7 +49,7 @@ struct ocfs2_alloc_context {
>>   
>>   	/* these are used by the chain search */
>>   	u16    ac_chain;
>> -	int    ac_allow_chain_relink;
>> +	int    ac_disable_chain_relink;
>>   	group_search_t *ac_group_search;
>>   
>>   	u64    ac_last_group;
> 
> 
> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/ocfs2-devel
> 

  reply	other threads:[~2012-12-03  8:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-15  1:20 [Ocfs2-devel] [PATCH] run out of jbd2 credits during discontig group alloc xiaowei.hu at oracle.com
2012-12-03  5:23 ` Xiaowei
2012-12-03  8:33   ` Jeff Liu [this message]
2012-12-03  8:51     ` Xiaowei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50BC63CD.8020905@oracle.com \
    --to=jeff.liu@oracle.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.