linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Wolfram Sang <w.sang@pengutronix.de>
Cc: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>,
	Ingo Molnar <mingo@elte.hu>,
	dwmw2@infradead.org, linux-mtd@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC] jffs2: use cond_resched() instead of yield()
Date: Wed, 01 Sep 2010 21:35:51 +0300	[thread overview]
Message-ID: <1283366151.2209.21.camel@brekeke> (raw)
In-Reply-To: <1283357021-16187-1-git-send-email-w.sang@pengutronix.de>

This 'yield()' was introduced by dwmw2, so he may have strong feelings
about it. CCed.

On Wed, 2010-09-01 at 18:03 +0200, Wolfram Sang wrote:
> yield() has different semantics meanwhile and even causes RT-kernels to
> BUG. Replace the only appearance left in jffs2.
> 
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> Cc: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
> Cc: Ingo Molnar <mingo@elte.hu>
> ---
> 
> The aforementioned BUG() showed up in one of our customer's RT-projects. While
> this could be handled by rearranging his thread-priorities, I wondered if such
> a patch would be worthwhile, still. Reading through the material covering
> yield() and related replacements, I believe this patch should be appropriate.
> Please say if I missed some side-effects.
> 
>  fs/jffs2/erase.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c
> index abac961..e513f19 100644
> --- a/fs/jffs2/erase.c
> +++ b/fs/jffs2/erase.c
> @@ -151,7 +151,7 @@ int jffs2_erase_pending_blocks(struct jffs2_sb_info *c, int count)
>  		}
>  
>  		/* Be nice */
> -		yield();
> +		cond_resched();
>  		mutex_lock(&c->erase_free_sem);
>  		spin_lock(&c->erase_completion_lock);
>  	}

-- 
Best Regards,
Artem Bityutskiy (Битюцкий Артём)

  reply	other threads:[~2010-09-01 18:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-01 16:03 [RFC] jffs2: use cond_resched() instead of yield() Wolfram Sang
2010-09-01 18:35 ` Artem Bityutskiy [this message]
2010-09-02  7:01   ` Joakim Tjernlund
2010-09-02 10:59     ` Artem Bityutskiy
2010-09-02 13:52       ` Joakim Tjernlund
2010-09-20 13:00 ` Artem Bityutskiy

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=1283366151.2209.21.camel@brekeke \
    --to=dedekind1@gmail.com \
    --cc=Artem.Bityutskiy@nokia.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mingo@elte.hu \
    --cc=w.sang@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).