All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 7/7] Fix the case of jiffies wrapping in mm/pdflush.c
Date: Mon, 30 Jun 2008 20:34:01 -0700	[thread overview]
Message-ID: <20080630203401.f9bcfe84.akpm@linux-foundation.org> (raw)
In-Reply-To: <a553a85a3e848699d00711608.ps@mail.parknet.co.jp>

On Tue, 01 Jul 2008 11:57:04 +0900 OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> wrote:

> 
> 
> Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
> ---
> 
>  mm/pdflush.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff -puN mm/pdflush.c~pdfluh-jiffies-check-fix mm/pdflush.c
> --- linux-2.6/mm/pdflush.c~pdfluh-jiffies-check-fix	2008-07-01 10:19:07.000000000 +0900
> +++ linux-2.6-hirofumi/mm/pdflush.c	2008-07-01 10:19:07.000000000 +0900
> @@ -130,7 +130,7 @@ static int __pdflush(struct pdflush_work
>  		 * Thread creation: For how long have there been zero
>  		 * available threads?
>  		 */
> -		if (jiffies - last_empty_jifs > 1 * HZ) {
> +		if (time_after(jiffies, last_empty_jifs + 1 * HZ)) {
>  			/* unlocked list_empty() test is OK here */
>  			if (list_empty(&pdflush_list)) {
>  				/* unlocked test is OK here */
> @@ -151,7 +151,7 @@ static int __pdflush(struct pdflush_work
>  		if (nr_pdflush_threads <= MIN_PDFLUSH_THREADS)
>  			continue;
>  		pdf = list_entry(pdflush_list.prev, struct pdflush_work, list);
> -		if (jiffies - pdf->when_i_went_to_sleep > 1 * HZ) {
> +		if (time_after(jiffies, pdf->when_i_went_to_sleep + 1 * HZ)) {
>  			/* Limit exit rate */
>  			pdf->when_i_went_to_sleep = jiffies;
>  			break;					/* exeunt */

I don't think this actually "fixes" anything, does it?  The old code
should be correct at runtime.

I renamed the patch to "pdflush: use time_after() instead of open-coding it".


  reply	other threads:[~2008-07-01  3:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-01  2:57 [PATCH 1/7] fat: Fix parse_options() OGAWA Hirofumi
2008-07-01  2:57 ` [PATCH 2/7] fat: Fix VFAT_IOCTL_READDIR_xxx and cleanup for userland OGAWA Hirofumi
2008-07-01  2:57   ` [PATCH 3/7] fat/dir.c: switch to struct __fat_dirent OGAWA Hirofumi
2008-07-01  2:57     ` [PATCH 4/7] fat: cleanup fs/fat/dir.c OGAWA Hirofumi
2008-07-01  2:57       ` [PATCH 5/7] fat: use same logic in fat_search_long() and __fat_readdir() OGAWA Hirofumi
2008-07-01  2:57         ` [PATCH 6/7] fat: small optimaize __fat_readdir() OGAWA Hirofumi
2008-07-01  2:57           ` [PATCH 7/7] Fix the case of jiffies wrapping in mm/pdflush.c OGAWA Hirofumi
2008-07-01  3:34             ` Andrew Morton [this message]
2008-07-01  4:05               ` OGAWA Hirofumi
2008-07-01 12:22       ` [PATCH 4/7] fat: cleanup fs/fat/dir.c Christoph Hellwig
2008-07-01 14:16         ` OGAWA Hirofumi
2008-07-01  3:32     ` [PATCH 3/7] fat/dir.c: switch to struct __fat_dirent Andrew Morton
2008-07-01  3:54       ` OGAWA Hirofumi
2008-07-01  7:40   ` [PATCH 2/7] fat: Fix VFAT_IOCTL_READDIR_xxx and cleanup for userland Christoph Hellwig
2008-07-01  8:33     ` OGAWA Hirofumi
2008-07-01 11:22     ` Adrian Bunk
2008-07-01 12:18       ` Christoph Hellwig
2008-07-01 12:20   ` Christoph Hellwig
2008-07-01 13:15     ` OGAWA Hirofumi

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=20080630203401.f9bcfe84.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    /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.