All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Zhao Forrest <forrest.zhao@gmail.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: Why kmem_cache_free occupy CPU for more than 10 seconds?
Date: Wed, 11 Apr 2007 12:38:31 +0200	[thread overview]
Message-ID: <1176287911.6893.47.camel@twins> (raw)
In-Reply-To: <ac8af0be0704110253p74de6197p1df6a5b99585709c@mail.gmail.com>

On Wed, 2007-04-11 at 17:53 +0800, Zhao Forrest wrote:
> I got some new information:
> Before soft lockup message is out, we have:
> [root@nsgsh-dhcp-149 home]# cat /proc/slabinfo |grep buffer_head
> buffer_head       10927942 10942560    120   32    1 : tunables   32
> 16    8 : slabdata 341955 341955      6 : globalstat 37602996 11589379
> 1174373    6                              0    1 6918 12166031 1013708
> : cpustat 35254590 2350698 13610965 907286
> 
> Then after buffer_head is freed, we have:
> [root@nsgsh-dhcp-149 home]# cat /proc/slabinfo |grep buffer_head
> buffer_head         9542  36384    120   32    1 : tunables   32   16
>   8 : slabdata   1137   1137    245 : globalstat 37602996 11589379
> 1174373    6                                  0    1 6983 20507478
> 1708818 : cpustat 35254625 2350704 16027174 1068367
> 
> Does this huge number of buffer_head cause the soft lockup?


__blkdev_put() takes the BKL and bd_mutex
invalidate_mapping_pages() tries to take the PageLock

But no other looks seem held while free_buffer_head() is called

All these locks are preemptible (CONFIG_PREEMPT_BKL?=y) and should not
hog the cpu like that, what preemption mode have you got selected?
(CONFIG_PREEMPT_VOLUNTARY?=y)

Does this fix it?

--- fs/buffer.c~	2007-02-01 12:00:34.000000000 +0100
+++ fs/buffer.c	2007-04-11 12:35:48.000000000 +0200
@@ -3029,6 +3029,8 @@ out:
 			struct buffer_head *next = bh->b_this_page;
 			free_buffer_head(bh);
 			bh = next;
+
+			cond_resched();
 		} while (bh != buffers_to_free);
 	}
 	return ret;





WARNING: multiple messages have this Message-ID (diff)
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Zhao Forrest <forrest.zhao@gmail.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: Why kmem_cache_free occupy CPU for more than 10 seconds?
Date: Wed, 11 Apr 2007 12:38:31 +0200	[thread overview]
Message-ID: <1176287911.6893.47.camel@twins> (raw)
In-Reply-To: <ac8af0be0704110253p74de6197p1df6a5b99585709c@mail.gmail.com>

On Wed, 2007-04-11 at 17:53 +0800, Zhao Forrest wrote:
> I got some new information:
> Before soft lockup message is out, we have:
> [root@nsgsh-dhcp-149 home]# cat /proc/slabinfo |grep buffer_head
> buffer_head       10927942 10942560    120   32    1 : tunables   32
> 16    8 : slabdata 341955 341955      6 : globalstat 37602996 11589379
> 1174373    6                              0    1 6918 12166031 1013708
> : cpustat 35254590 2350698 13610965 907286
> 
> Then after buffer_head is freed, we have:
> [root@nsgsh-dhcp-149 home]# cat /proc/slabinfo |grep buffer_head
> buffer_head         9542  36384    120   32    1 : tunables   32   16
>   8 : slabdata   1137   1137    245 : globalstat 37602996 11589379
> 1174373    6                                  0    1 6983 20507478
> 1708818 : cpustat 35254625 2350704 16027174 1068367
> 
> Does this huge number of buffer_head cause the soft lockup?


__blkdev_put() takes the BKL and bd_mutex
invalidate_mapping_pages() tries to take the PageLock

But no other looks seem held while free_buffer_head() is called

All these locks are preemptible (CONFIG_PREEMPT_BKL?=y) and should not
hog the cpu like that, what preemption mode have you got selected?
(CONFIG_PREEMPT_VOLUNTARY?=y)

Does this fix it?

--- fs/buffer.c~	2007-02-01 12:00:34.000000000 +0100
+++ fs/buffer.c	2007-04-11 12:35:48.000000000 +0200
@@ -3029,6 +3029,8 @@ out:
 			struct buffer_head *next = bh->b_this_page;
 			free_buffer_head(bh);
 			bh = next;
+
+			cond_resched();
 		} while (bh != buffers_to_free);
 	}
 	return ret;




--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2007-04-11 10:38 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-11  6:17 Why kmem_cache_free occupy CPU for more than 10 seconds? Zhao Forrest
2007-04-11  6:17 ` Zhao Forrest
2007-04-11  6:53 ` Pekka Enberg
2007-04-11  6:53   ` Pekka Enberg
2007-04-11  9:14   ` Zhao Forrest
2007-04-11  9:14     ` Zhao Forrest
2007-04-11  9:53     ` Paul Jackson
2007-04-11  9:53       ` Paul Jackson
2007-04-11 10:06       ` Peter Zijlstra
2007-04-11 10:06         ` Peter Zijlstra
2007-04-11 10:10         ` Zhao Forrest
2007-04-11 10:10           ` Zhao Forrest
2007-04-11 10:16           ` Peter Zijlstra
2007-04-11 10:16             ` Peter Zijlstra
2007-04-11 16:23           ` Chuck Ebbert
2007-04-11 16:23             ` Chuck Ebbert
2007-04-11 16:44           ` Badari Pulavarty
2007-04-11 16:44             ` Badari Pulavarty
2007-04-11  9:53   ` Zhao Forrest
2007-04-11  9:53     ` Zhao Forrest
2007-04-11 10:38     ` Peter Zijlstra [this message]
2007-04-11 10:38       ` Peter Zijlstra
2007-04-11 16:35       ` Ken Chen
2007-04-11 16:35         ` Ken Chen
2007-04-12  6:17       ` Zhao Forrest
2007-04-12  6:17         ` Zhao Forrest
2007-04-11 22:30 ` Andrew Morton
2007-04-11 22:30   ` Andrew Morton
2007-04-12  7:39   ` Peter Zijlstra
2007-04-12  7:39     ` Peter Zijlstra
2007-04-12  7:55     ` Andrew Morton
2007-04-12  7:55       ` Andrew Morton
2007-04-12  9:19       ` Peter Zijlstra
2007-04-12  9:19         ` Peter Zijlstra
     [not found] <fa.jxja7Ze2HZEPZZ5vd0w5eLsKf88@ifi.uio.no>
     [not found] ` <fa.RbU8KKG9LmOiypCl0DuBe43HL5c@ifi.uio.no>
     [not found]   ` <fa.7mgz+w23+bQoEmP17EX7CoXvAKk@ifi.uio.no>
     [not found]     ` <fa.Iwu0x59X2e1XgdDQWyXObWrcbFY@ifi.uio.no>
     [not found]       ` <fa.Aj3PE3FoH/kmJ6APQFg2oZN1OFc@ifi.uio.no>
2007-04-13 23:26         ` Robert Hancock

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=1176287911.6893.47.camel@twins \
    --to=a.p.zijlstra@chello.nl \
    --cc=forrest.zhao@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@cs.helsinki.fi \
    /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.