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: <1340231192.21745.154.camel@twins>
Date:	Thu, 21 Jun 2012 00:26:32 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Frederic Weisbecker <fweisbec@...il.com>
Cc:	Ingo Molnar <mingo@...nel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	LKML <linux-kernel@...r.kernel.org>,
	Tony Luck <tony.luck@...el.com>,
	Fenghua Yu <fenghua.yu@...el.com>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Paul Mackerras <paulus@...ba.org>,
	Martin Schwidefsky <schwidefsky@...ibm.com>,
	Heiko Carstens <heiko.carstens@...ibm.com>,
	Venkatesh Pallipadi <venki@...gle.com>
Subject: Re: [PATCH 0/4] cputime: Virtual cputime accounting small cleanups
 and consolidation

On Tue, 2012-06-19 at 15:43 +0200, Frederic Weisbecker wrote:
> 
> I wish we could do more vtime cputime accounting consolidation
> but archs do the things pretty differently although I bet the
> behaviour could be more unified.
> 
Yes.. so s390,ia64 use thread_info, ppc uses their paca (arch private
precursor to per-cpu data).

So I understand why s390,ia64 want the sched hook, but I don't see why
ppc would need it, their account_process_tick() can fold whatever they
need on the tick.

So I think reworking s390,ia64 to use per-cpu storage should get rid of
this switch hook altogether.


Now everybody using VIRT_CPU_ACCOUNTING has the
syscall/__irq_{enter,exit} hooks and uses 64bit cputime_t.

IRQ_TIME_ACCOUNTING only has the __irq_{enter,exit} hook and uses
unsigned long cputime_t, it adds cputime_one_jiffy every tick when the
per-cpu counter is ahead of the cputime.


We could merge both and do away with the 64bit cputime thing by keeping
a (2nd) per-cpu kernel_cpustat which we fill with optional syscall/irq
hooks and have account_process_tick() first check if any of the
fine-grained fields overflow and if not, fall back to the regular tick
accounting (much like an extended irqtime_account_process_tick).


This would merge the fine-grain and tick based code-paths and do away
with the whole cputime_t mess, it would also merge the VIRT and IRQ
paths and make Frederic's optional syscall accounting trivial.

Or am I missing something obvious here? -- its late after all.

I'll try and write some code tomorrow.
--
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