lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090612142546.GC3784@redhat.com>
Date:	Fri, 12 Jun 2009 16:25:46 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	Stanislaw Gruszka <sgruszka@...hat.com>
Cc:	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Thomas Gleixner <tglx@...utronix.de>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Ingo Molnar <mingo@...e.hu>
Subject: Re: [RFC PATCH] posix-cpu-timers: optimize calling
	thread_group_cputime()

To clarify, I am not arguing against this patch, just a queston.

On 06/12, Stanislaw Gruszka wrote:
>
> On Fri, 12 Jun 2009 13:09:46 +0200
> Peter Zijlstra <a.p.zijlstra@...llo.nl> wrote:
>
> > On Fri, 2009-06-12 at 12:39 +0200, Stanislaw Gruszka wrote:
> > > -               times->utime = cputime_add(times->utime, t->utime);
> > > -               times->stime = cputime_add(times->stime, t->stime);
> > > -               times->sum_exec_runtime += t->se.sum_exec_runtime;
> > > +               if (mask & TG_CPUCLOCK_UTIME)
> > > +                       times->utime = cputime_add(times->utime, t->utime);
> > > +               if (mask & TG_CPUCLOCK_STIME)
> > > +                       times->stime = cputime_add(times->stime, t->stime);
> > > +               if (mask & TG_CPUCLOCK_SCHED)
> > > +                       times->sum_exec_runtime += t->se.sum_exec_runtime;
> >
> > Does adding 3 branches really make it faster?
> Actually I did not any benchmarking yet, so I don't know what is the real
> impact of the patch. I hope it make things taster but the result can be
> opposite from my expectations.

I agree with Peter, if we complicate the code it would be nice to know
this really makes it faster. Besides, thread_group_cputime() should not
be called that often.

Perhaps it makes sense to turn ->running into bitmask though, this should
"obviously" speed up account_group_xxx() helpers.

But in that case, perhaps stop_process_timers() should accept bitmask too?
otherwise this doesn't look "complete".

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ