All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: David Howells <dhowells@redhat.com>
Cc: john stultz <johnstul@us.ibm.com>, Adrian Bunk <bunk@stusta.de>,
	Andrew Morton <akpm@osdl.org>,
	Arjan van de Ven <arjan@linux.intel.com>,
	linux-kernel@vger.kernel.org, Jeff Garzik <jeff@garzik.org>,
	netdev@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: Re: [PATCH] FRV: do_gettimeofday() should no longer use tickadj
Date: Sat, 9 Sep 2006 07:46:42 +0200	[thread overview]
Message-ID: <20060909054642.GA8859@elte.hu> (raw)
In-Reply-To: <17274.1157553962@warthog.cambridge.redhat.com>


* David Howells <dhowells@redhat.com> wrote:

> Ingo Molnar <mingo@elte.hu> wrote:
> 
> > we'll get rid of that pt_regs thing centrally, from all drivers at once 
> > - there's upstream buy-in for that already, and Thomas already generated 
> > a test-patch for that a few months ago. But it's not a big issue right 
> > now.
> 
> Yay!  Can you give me a pointer to the patch?

i cannot find Thomas' recent 2.6 one (Thomas, do you have a link to 
it?), but i did one 5 years ago:

 http://people.redhat.com/mingo/irq-rewrite-patches/irq-cleanup-2.4.15-B1.bz2

in general it's a large but otherwise pretty dumb patch.

> > this shouldnt be a big issue either - we use indirect jumps all around 
> > the kernel.
> 
> Yes, I know.  I'm sometimes concerned at just how fast indirect jumps 
> (and even direct calls) are proliferating.  Look at the read syscall 
> path for something like ext3 these days: it's like a pile of 
> spaghetti.  That seems particularly true of direct-IO where it seems 
> to weave in and out of core code and the filesystem as it goes down.  
> I'm also concerned about stack usage.

yeah - but unless you can suggest some low-maintainance-overhead 
solution, not much can be done i suspect: being a few cycles slower is a 
lot less of a problem than being less flexible in the design. In general 
CPUs do optimize this quite well, but it is true that not every CPU 
does.

> > CPUs are either smart enough to predict it
> 
> I was told a while back (2002?) not to use indirect pointers for some 
> stuff because CPUs _couldn't_ predict it.  Maybe this has changed in 
> modern CPUs.

indirect pointers are very common both in OSs and in applications, 
especially in C++ based ones, where lots of execution goes off dynamic 
objects which have function pointers associated to them. So _lots_ of 
effort goes into branch prediction on the hardware side - and yes, 
modern CPUs do quite well with indirect pointers too.

The worst-case scenario is when the indirect branch flip-flops between 
multiple destination addresses - but that shouldnt be an issue for 
genirq because most systems have _one_ preferred way of handling 
interrupts that the majority of interrupt traffic uses. (for example on 
i686 it's level-triggered PCI irqs)

But even if there's multiple destinations from the indirect jump, newest 
CPUs (such as Core 2) can actually store _multiple_ branch history 
targets and can prefetch all of them at once (if there's idle capacity 
left).

(And i wouldnt be surprised if some modern CPUs already stored the 
indirection register's index in the BHT, and used that for the 
prediction. Most indirect calls happen off registers, and if the 
compiler loads the register early enough (which it typically does) then 
the branch target value is available to the CPU. Other context 
information can be included in a BHT too.)

Also, in general, if something is arguably a smart thing to do in an OS 
(and more design flexibility via function pointers is a smart thing for 
which there is no viable alternative), we can expect CPUs to get 
gradually better at handling them.

> > >  (4) No account is taken of interrupt priority.
> > 
> > hm, i'm not sure what you mean - could you be more specific?
> 
> The FRV CPU, like many others, supports interrupt prioritisation.  A 
> particular interrupt level is set in the PSR, and any interrupt of a 
> higher priority can interrupt.  do_IRQ() can then do the interrupt 
> processing in the interrupt level of the interrupt that invoked it, 
> thus permitting higher priority interrupts to still happen.

ah, ok. For PREEMPT_HARDIRQS we thought about possibly utilizing 
hw-level IRQ prioritization too - but it's quite inflexible in most IRQ 
controller designs: the prioritization is rarely integrated with the CPU 
and is often attached to the ACK/EOI-ing of the IRQ line (and an 
unACK-ed IRQ can have side-effects).

So the thing we chose for PREEMPT_HARDIRQS was to do the prioritization 
at the OS/scheduler level. And OS level handling of this is what we need 
anyway: IRQ handlers are just the first, often tiny portion in a 
critical workload that a system must perform. (we have softirqs, 
signals, tasks, etc.) Nevertheless the door is open to utilize hw 
capabilities of IRQ prioritization - we 'only' need standard driver and 
/sys APIs to make use of them.

	Ingo

  parent reply	other threads:[~2006-09-09  5:54 UTC|newest]

Thread overview: 143+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-01  8:58 2.6.18-rc5-mm1 Andrew Morton
2006-09-01  9:53 ` 2.6.18-rc5-mm1 Manuel Lauss
2006-09-01 10:44 ` 2.6.18-rc5-mm1 Grant Wilson
2006-09-01 13:50   ` [-mm patch] drivers/md/Kconfig: fix BLOCK dependency Adrian Bunk
2006-09-01 13:50     ` Adrian Bunk
2006-09-01 14:15     ` David Howells
2006-09-01 14:26       ` Jens Axboe
2006-09-01 16:00 ` 2.6.18-rc5-mm1: drivers/infiniband/hw/amso1100/c2.c compile error Adrian Bunk
2006-09-01 17:13   ` Andrew Morton
2006-09-01 17:34     ` Roland Dreier
2006-09-01 18:23       ` Andrew Morton
2006-09-01 19:53         ` Roland Dreier
2006-09-01 20:04           ` Andrew Morton
2006-09-01 20:20             ` Tom Tucker
2006-09-01 20:43             ` Russell King
2006-09-01 20:54               ` Roland Dreier
2006-09-01 21:01                 ` [openib-general] " Bryan O'Sullivan
2006-09-01 20:59               ` Andrew Morton
2006-09-01 21:05                 ` Roland Dreier
2006-09-01 21:26                   ` Andrew Morton
2006-09-01 22:42                     ` Roland Dreier
2006-09-01 20:51             ` Roland Dreier
2006-09-01 21:03               ` Andrew Morton
2006-09-01 20:45           ` [openib-general] " Bryan O'Sullivan
2006-09-01 20:59             ` Roland Dreier
2006-09-01 21:03               ` Bryan O'Sullivan
2006-09-01 16:40 ` 2.6.18-rc5-mm1 Maciej Rutecki
2006-09-05 16:16   ` 2.6.18-rc5-mm1 Bjorn Helgaas
2006-09-06 16:55     ` 2.6.18-rc5-mm1 Maciej Rutecki
2006-09-07  3:08       ` 2.6.18-rc5-mm1 Andrew Morton
2006-09-07  3:08         ` 2.6.18-rc5-mm1 Andrew Morton
2006-09-07 17:33         ` 2.6.18-rc5-mm1 keith mannthey
2006-09-07 17:33           ` 2.6.18-rc5-mm1 keith mannthey
2006-09-01 19:58 ` [-mm patch] fs/reiser4/: possible cleanups Adrian Bunk
2006-09-01 23:13 ` 2.6.18-rc5-mm1 (IDE resume regression) Rafael J. Wysocki
2006-09-02  0:08   ` Andrew Morton
2006-09-02  1:00 ` 2.6.18-rc5-mm1 Matthias Hentges
2006-09-02  1:30   ` 2.6.18-rc5-mm1 Andrew Morton
     [not found]     ` <44F93EB3.8050500@goop.org>
2006-09-02  8:37       ` 2.6.18-rc5-mm1 Jeremy Fitzhardinge
2006-09-02  8:44         ` 2.6.18-rc5-mm1 Greg KH
2006-09-02  8:47           ` 2.6.18-rc5-mm1 Jeremy Fitzhardinge
2006-09-02  8:52             ` 2.6.18-rc5-mm1 Greg KH
2006-09-02  9:36               ` 2.6.18-rc5-mm1 Jeremy Fitzhardinge
2006-09-02  9:38                 ` 2.6.18-rc5-mm1 Jeff Garzik
2006-09-02  9:47                   ` 2.6.18-rc5-mm1 Jeremy Fitzhardinge
2006-09-02  9:56                   ` 2.6.18-rc5-mm1 Jeremy Fitzhardinge
2006-09-09 23:47           ` 2.6.18-rc5-mm1 Jeremy Fitzhardinge
2006-09-10 16:24             ` 2.6.18-rc5-mm1 Matthias Hentges
2006-09-02  1:06 ` 2.6.18-rc5-mm1 Grant Coady
2006-09-02  1:12   ` 2.6.18-rc5-mm1 Dmitry Torokhov
2006-09-02  1:33     ` 2.6.18-rc5-mm1 Dmitry Torokhov
2006-09-02  2:10     ` 2.6.18-rc5-mm1 Grant Coady
2006-09-02  1:39   ` 2.6.18-rc5-mm1 Andrew Morton
2006-09-02  3:51     ` 2.6.18-rc5-mm1 Grant Coady
2006-09-02 20:20       ` 2.6.18-rc5-mm1 Grant Coady
2006-09-02 20:38         ` "VGER BF report:.." ? Matti Aarnio
2006-09-03 15:06           ` Jan Engelhardt
2006-09-03 19:59             ` Grant Coady
2006-09-02  9:05 ` 2.6.18-rc5-mm1 Philippe Gramoullé
2006-09-02 11:40   ` 2.6.18-rc5-mm1 Stefan Richter
2006-09-02 11:51     ` 2.6.18-rc5-mm1 Philippe Gramoullé
2006-09-03  9:09 ` [2.6.18-rc5-mm1 ACPI] Unknown exception code: 0xFFFFFFEA Mike Galbraith
2006-09-03  9:09   ` Mike Galbraith
2006-09-05 16:18   ` Bjorn Helgaas
2006-09-03 17:25 ` 2.6.18-rc5-mm1: sysfs_init() related compile error Adrian Bunk
2006-09-03 22:17 ` 2.6.18-rc5-mm1: MMU=n " Adrian Bunk
2006-09-04  7:44   ` Peter Zijlstra
2006-09-04 15:44     ` Adrian Bunk
2006-09-03 23:34 ` Lost DVD-RW [Was Re: 2.6.18-rc5-mm1] J.A. Magallón
2006-09-04  1:12   ` Andrew Morton
2006-09-04  2:42     ` Tejun Heo
2006-09-04 22:26       ` J.A. Magallón
2006-09-07  9:34         ` Tejun Heo
2006-09-07 11:13           ` J.A. Magallón
2006-09-07 11:32             ` [PATCH libata-dev#upstream-fixes] libata: ignore CFA signature while sanity-checking an ATAPI device Tejun Heo
2006-09-07 20:27               ` Andrew Morton
2006-09-07 21:03                 ` Jeff Garzik
2006-09-08  7:56                   ` Tejun Heo
2006-09-09 14:46           ` Lost DVD-RW [Was Re: 2.6.18-rc5-mm1] Alan Cox
2006-09-04 11:41 ` 2.6.18-rc5-mm1: is_init() parisc compile error Adrian Bunk
2006-09-04 13:48   ` [parisc-linux] " Matthew Wilcox
2006-09-04 18:24     ` [PATCH] Fix conflict with the is_init identifier on parisc Eric W. Biederman
2006-09-04 18:41       ` Adrian Bunk
2006-09-04 19:18       ` Andrew Morton
2006-09-04 18:24     ` [parisc-linux] " Eric W. Biederman
2006-09-04 17:03 ` [-mm patch] drivers/infiniband/hw/amso1100/: possible cleanups Adrian Bunk
2006-09-04 17:03 ` [-mm patch] make fs/lockd/host.c:nlm_lookup_host() static Adrian Bunk
2006-09-04 17:04 ` 2.6.18-rc5-mm1: ARCH_DISCONTIGMEM_ENABLE=y, SMP=n compile error Adrian Bunk
2006-09-04 19:04   ` Andrew Morton
2006-09-04 19:24     ` Adrian Bunk
2006-09-04 17:04 ` [-mm patch] fix kernel_execve() related compile errors Adrian Bunk
2006-09-04 17:04 ` [-mm patch] lib/ioremap.c must #include <linux/mm.h> Adrian Bunk
2006-09-04 18:41 ` [-mm patch] mm/memory_hotplug.c must #include <linux/cpuset.h> Adrian Bunk
2006-09-04 22:17 ` [-mm patch] arch/m68knommu/kernel/sys_m68k.c must #include <asm/unistd.h> Adrian Bunk
2006-09-05 13:03 ` lockdep oddity Heiko Carstens
2006-09-05 18:12   ` Ingo Molnar
2006-09-05 18:57     ` Hua Zhong
2006-09-05 18:52       ` Ingo Molnar
2006-09-05 19:08     ` Ingo Molnar
2006-09-05 19:37       ` Ingo Molnar
2006-09-06  6:54         ` Heiko Carstens
2006-09-06 10:05           ` Ingo Molnar
2006-09-06  7:20     ` Heiko Carstens
2006-09-06  7:47       ` Andrew Morton
2006-09-06  8:01         ` Heiko Carstens
2006-09-06  8:23           ` Hua Zhong
2006-09-06  8:40             ` Ingo Molnar
2006-09-06 14:19               ` Daniel Walker
2006-09-06 14:29                 ` Heiko Carstens
2006-09-06 14:34                   ` Daniel Walker
2006-09-05 20:07   ` Daniel Walker
2006-09-06  7:18     ` Heiko Carstens
2006-09-06 11:58     ` Heiko Carstens
2006-09-05 13:25 ` 2.6.18-rc5-mm1: {dis,en}able_irq_lockdep_irqrestore compile error Adrian Bunk
2006-09-05 15:21   ` [PATCH] FRV: Fix " David Howells
2006-09-06 12:50     ` Ingo Molnar
2006-09-05 15:27   ` [PATCH] NOMMU: Move the fallback arch_vma_name() to a sensible place David Howells
2006-09-05 15:29   ` [PATCH] NOMMU: Provide page_mkclean() for NOMMU David Howells
2006-09-05 15:31   ` [PATCH] NOMMU: Make lib/ioremap.c conditional David Howells
2006-09-05 15:35   ` [PATCH] FRV: do_gettimeofday() should no longer use tickadj David Howells
2006-09-06  1:46     ` john stultz
2006-09-06  9:27       ` David Howells
2006-09-06  9:43         ` Ingo Molnar
2006-09-06 12:30           ` David Howells
2006-09-06 12:56             ` Ingo Molnar
2006-09-06 14:46               ` David Howells
2006-09-06 23:01                 ` Benjamin Herrenschmidt
2006-09-07  9:55                   ` David Howells
2006-09-07 10:26                     ` Ingo Molnar
2006-09-07 13:34                       ` David Howells
2006-09-07 22:53                     ` Benjamin Herrenschmidt
2006-09-08 10:25                       ` David Howells
2006-09-08 11:05                         ` Benjamin Herrenschmidt
2006-09-08 12:24                           ` David Howells
2006-09-08 12:29                       ` David Howells
2006-09-11  4:06                         ` Benjamin Herrenschmidt
2006-09-09  5:46                 ` Ingo Molnar [this message]
2006-09-11 10:46                   ` David Howells
2006-09-05 16:00 ` 2.6.18-rc5-mm1 dependency on curses devel still there Steve Fox
2006-09-06 23:06 ` [-mm patch] ATA_JMICRON: remove the superfluous ATA dependency Adrian Bunk
2006-09-06 23:07 ` [-mm patch] ACPI_SONY shouldn't default m Adrian Bunk
2006-09-07  3:30   ` Andrew Morton
2006-09-07  4:41     ` Randy.Dunlap

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=20060909054642.GA8859@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --cc=arjan@linux.intel.com \
    --cc=benh@kernel.crashing.org \
    --cc=bunk@stusta.de \
    --cc=dhowells@redhat.com \
    --cc=jeff@garzik.org \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.