Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1480510 > unrolled thread
| Started by | Thomas Gleixner <tglx@linutronix.de> |
|---|---|
| First post | 2016-09-10 08:20 +0200 |
| Last post | 2016-09-14 19:20 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] fs/dcache: resched/chill only if we make no progress Thomas Gleixner <tglx@linutronix.de> - 2016-09-10 08:20 +0200
Re: [PATCH] fs/dcache: resched/chill only if we make no progress Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-09-14 19:20 +0200
| From | Thomas Gleixner <tglx@linutronix.de> |
|---|---|
| Date | 2016-09-10 08:20 +0200 |
| Subject | Re: [PATCH] fs/dcache: resched/chill only if we make no progress |
| Message-ID | <sfJNU-50v-3@gated-at.bofh.it> |
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
[toc] | [next] | [standalone]
| From | Sebastian Andrzej Siewior <bigeasy@linutronix.de> |
|---|---|
| Date | 2016-09-14 19:20 +0200 |
| Message-ID | <shm0N-3Fk-13@gated-at.bofh.it> |
| In reply to | #1480510 |
On 2016-09-10 08:17:13 [+0200], Thomas Gleixner wrote:
> 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.
something like
|#ifdef CONFIG_SMP
| task_running(task_rq(lock_owner), lock_owner))
|#else
| 1)
|#endif
| cpu_chill();
the lock_owner is tricky because we have two locks: inode->i_lock and
parent->d_lock. So we would have to do the same lookup, like
dentry_kill() is doing, and check both in worth case.
Sebastian
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web