"SMP" scheduler_tick confusion

From: Alfred Rossi (alfredr_at_gmail.com)
Date: 09/13/04

  • Next message: Joshua Schmidlkofer: "Re: [ck] Re: 2.6.8.1-ck7, Two Badnessess, one dump."
    Date:	Mon, 13 Sep 2004 11:26:04 -0400
    To: linux-kernel@vger.kernel.org
    
    

    Since scheduler_tick handles time-slice maintenance in the kernel, I
    was under the impression that with HZ (asm/param.h) frequency each cpu
    in an SMP scenario should run scheduler_tick shortly after the timer
    interrupt fires. I believe this should be the case since each cpu
    could simultaneously be executing a separate task, each task would
    need to have it's time slices adjusted. This does not appear to be
    what actually happens. I looked around the source for a bit, and
    couldn't find anything to convince me that each cpu runs
    scheduler_tick independently, so I decided to perform a little
    experiment. It's ugly, I know, but I placed a printk in scheduler tick
    with the cpu's id. sampled the output from scheduler_tick for 1
    second, and then analyzed the remaining file. With a HZ of 1000 and 2
    Cpu's I expected to at least have very close to 2000 characters, with
    a near equal number of 1's and 0's. Since the timer interrupt was
    generated by the same timer for both cpu's I also expected to see a
    regular pattern with an even distribution of 1's and 0's. Instead what
    I found is that I had 996 characters (close enough to HZ, wish my
    timing was better), and a random pattern of 1's and 0's, each
    composing roughly half of the overall file. Which gives me the
    impression that the first available cpu is handling the interrupt.
    Wouldn't that throw off the intended functioning of scheduler_tick?
    The machine this was tested on, I must note, was not a true SMP but a
    P4 with HT enabled. Could someone shed some light on this? What am I
    missing?

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


  • Next message: Joshua Schmidlkofer: "Re: [ck] Re: 2.6.8.1-ck7, Two Badnessess, one dump."

    Relevant Pages

    • raid5:md3: read error corrected , followed by , Machine Check Exception: .
      ... Hello All, I was under the impression that a 'machine check' would be caused by some near to the CPU hardware failure, Not a bad disk? ... CPU 5: Machine Check Exception: 0000000000000004 ...
      (Linux-Kernel)
    • Re: [PATCH] mm: Implement swap prefetching tweaks
      ... was under the impression that you were doing minimal IO and absolutely ... trivial CPU. ... A lot of cpu would be easier to handle; ... There used to be a pages in flight 'restrictor plate' in there that ...
      (Linux-Kernel)
    • cpu speed...what does it all mean?
      ... I had been under the impression ...probably wrongly..that the speed of a cpu ... Made a note in Motherboard Monitor (MBM) of the cpu speed with sides of the ...
      (alt.comp.hardware.pc-homebuilt)
    • cpu speed - what does it mean?
      ... I had been under the impression ...probably wrongly..that the speed of a cpu ... Made a note in Motherboard Monitor (MBM) of the cpu speed with sides of the ...
      (uk.comp.homebuilt)
    • Re: Atmel releasing FLASH AVR32 ?
      ... A dual thread 40 MHz CPU can replace two 20 MHz CPUs. ... that a thread can only run max 1/2 or 1/3rd of the cycles ... switch at the start of the pipeline, ... equivalent to the interrupt latency. ...
      (comp.arch.embedded)