From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754405AbcIJGTk (ORCPT ); Sat, 10 Sep 2016 02:19:40 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:50739 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752190AbcIJGTi (ORCPT ); Sat, 10 Sep 2016 02:19:38 -0400 Date: Sat, 10 Sep 2016 08:17:13 +0200 (CEST) From: Thomas Gleixner To: Sebastian Andrzej Siewior cc: linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org, Steven Rostedt Subject: Re: [PATCH] fs/dcache: resched/chill only if we make no progress In-Reply-To: <20160908182503.bh77mwwhjhiaqf4y@linutronix.de> Message-ID: References: <20160908182503.bh77mwwhjhiaqf4y@linutronix.de> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 8 Sep 2016, Sebastian Andrzej Siewior wrote: > + if (parent == dentry) { > + /* the task with the highest priority won't schedule */ > + r = cond_resched(); > + if (!r && (rt_task(current) || dl_task(current))) That's wrong because a non RT task will just spin until its time slice is up. Wasted cycles for nothing. Ideally we make spinning conditional on !on_cpu(dentry->lock->owner) That would avoid going to sleep if the owner runs on another cpu. We have no mechanism for that, but I think it'd be worth to think about one. > + cpu_chill(); > + } else > + dentry = parent; Missing braces Thanks, tglx