linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Gilad Ben-Yossef <gilad@benyossef.com>
To: Christoph Lameter <cl@linux.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [PATCH v2 1/2] mm: make vmstat_update periodic run conditional
Date: Thu, 8 Aug 2013 09:54:13 +0300	[thread overview]
Message-ID: <CAOtvUMe=QQni4Ouu=P_vh8QSb4ZdnaX_fW1twn3QFcOjYgJBGA@mail.gmail.com> (raw)
In-Reply-To: <0000013f61e7609b-a8d1907b-8169-4f77-ab83-a624a8d0ab4a-000000@email.amazonses.com>

On Thu, Jun 20, 2013 at 5:05 PM, Christoph Lameter <cl@linux.com> wrote:
>
> On Wed, 19 Jun 2013, Gilad Ben-Yossef wrote:
>
> > +static void vmstat_update(struct work_struct *w)
> > +{
> > +     int cpu, this_cpu = smp_processor_id();
> > +
> > +     if (unlikely(this_cpu == vmstat_monitor_cpu))
> > +             for_each_cpu_not(cpu, &vmstat_cpus)
> > +                     if (need_vmstat(cpu))
> > +                             start_cpu_timer(cpu);
> > +
> > +     if (likely(refresh_cpu_vm_stats(this_cpu) || (this_cpu ==
> > vmstat_monitor_cpu)))
> > +             schedule_delayed_work(&__get_cpu_var(vmstat_work),
> > +
> > round_jiffies_relative(sysctl_stat_interval));
> > +     else
> > +             cpumask_clear_cpu(this_cpu, &vmstat_cpus);
>
> The clearing of vmstat_cpus could be avoided if this processor is not
> running tickless. Frequent updates to vmstat_cpus could become an issue.

I like the idea of tying the vmstat disabling to the tickless logic
but I seem to have run
into a bit of a chicken and egg problem here:

vmstat_update runs from the vmstat work queue item by the workqueue
kernel thread.

If this code is running, it means there are at least two schedulable tasks:
1. The workqueue kernel thread, because it is running.
2. At least one more task, otherwise were were in idle and the
workqueue kernel thread
would not execute this work item.

Unfortunately, having two schedulable tasks means we're not running
tickless, so the check
will never trigger - or have I've missed something obvious?

Thanks,
Gilad


--
Gilad Ben-Yossef
Chief Coffee Drinker
gilad@benyossef.com
Israel Cell: +972-52-8260388
US Cell: +1-973-8260388
http://benyossef.com

"If you take a class in large-scale robotics, can you end up in a situation
where the homework eats your dog?"
 -- Jean-Baptiste Queru

--
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>

  parent reply	other threads:[~2013-08-08  6:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-18 15:23 vmstat kthreads Paul E. McKenney
2013-06-18 17:46 ` Christoph Lameter
2013-06-18 18:26   ` Paul E. McKenney
2013-06-19 14:23     ` Christoph Lameter
2013-06-19 14:50       ` Gilad Ben-Yossef
2013-06-19 14:57         ` Gilad Ben-Yossef
2013-06-20  5:06           ` Gilad Ben-Yossef
2013-06-19 14:59         ` Paul E. McKenney
2013-06-19 20:18           ` Christoph Lameter
2013-06-19 20:02         ` [PATCH v2 1/2] mm: make vmstat_update periodic run conditional Gilad Ben-Yossef
2013-06-20 14:05           ` Christoph Lameter
2013-08-07 18:16             ` Christoph Lameter
2013-08-08  6:28               ` Gilad Ben-Yossef
2013-08-08  6:54             ` Gilad Ben-Yossef [this message]
2013-08-08 14:59               ` Christoph Lameter
2013-08-09 18:56                 ` Gilad Ben-Yossef
2013-08-28 19:28                   ` Christoph Lameter
2013-06-19 20:02         ` [PATCH v2 2/2] mm: add sysctl to pick vmstat monitor cpu Gilad Ben-Yossef
2013-06-20 13:58           ` Christoph Lameter

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='CAOtvUMe=QQni4Ouu=P_vh8QSb4ZdnaX_fW1twn3QFcOjYgJBGA@mail.gmail.com' \
    --to=gilad@benyossef.com \
    --cc=cl@linux.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=paulmck@linux.vnet.ibm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox