From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takuya Yoshikawa Subject: Re: [RFC] sched: make callers check lock contention for cond_resched_lock() Date: Sat, 19 May 2012 01:10:01 +0900 Message-ID: <20120519011001.521acd09c636f97e38f000d6@gmail.com> References: <20120503171244.2debdd80931ccf35f387c5fe@gmail.com> <1336034127.13683.197.camel@twins> <20120503212244.6abbfa8bc3f46a7f7a932bb7@gmail.com> <1336048150.22523.17.camel@twins> <20120503220050.e91938418f882b4075526e08@gmail.com> <1336060050.22523.23.camel@twins> <20120511070357.9bf8f9b6636a12927f26bfed@gmail.com> <20120518072604.GG429@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Peter Zijlstra , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, kvm@vger.kernel.org, avi@redhat.com, mtosatti@redhat.com, yoshikawa.takuya@oss.ntt.co.jp To: Ingo Molnar Return-path: In-Reply-To: <20120518072604.GG429@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Fri, 18 May 2012 09:26:05 +0200 Ingo Molnar wrote: > I'm not sure we had a usable spin_is_contended() back then, nor > was the !PREEMPT case in my mind really. The fact that both spin_needbreak() and spin_is_contended() can be used outside of sched is a bit confusing. For example, in mm/compaction.c we are using spin_is_contended(), but in mm/memory.c spin_needbreak(). BTW, the actual users of spin_is_contended() look to be only: mm/compaction.c security/keys/gc.c > ( The patch looks ugly though, in 99% of the lines it just does > something that cond_resched_lock() itself could do. ) Please ignore the patch. I have already found a way to solve my problem without cond_resched(). Thanks, Takuya