Possible bug from kernel 2.6.22 and above
Hi, there:
We have a simple pthread program that measures the synchronization
overheads for various synchronization mechanisms such as spin locks, barriers (the barrier is implemented using queue-based barrier algorithm) and so on. We have dual quad-core AMD opterons (barcelona) clusters running 2.6.23.8 kernel at this moment using Fedora Core 7 distribution. Before we moved to this kernel, we had kernel 2.6.21. These two kernels are configured identical and compiled with the same gcc 4.1.2 compiler. Under the old kernel, we observed that the performance of these overheads increases as the number of threads increases from 2 to 8. The following are the values of total time and overhead for all threads acquiring a pthread spin lock and all threads executing a barrier synchronization call.
Kernel 2.6.21
Number of Threads 2 4 6 8
SpinLock (Time micro second) 10.5618 10.58538 10.5915 10.643
(Overhead) 0.073 0.05746 0.102805
0.154563
Barrier (Time micro second) 11.020410 11.678125 11.9889 12.38002
(Overhead) 0.531660 1.1502 1.500112 1.891617Each thread is bound to a particular core using pthread_setaffinity_np.
Kernel 2.6.23.8
Number of Threads 2 4 6 8
SpinLock (Time micro second) 14.849915 17.117603 14.4496 10.5990
(Overhead) 4.345417 6.617207 3.949435 0.110985
Barrier (Time micro second) 19.462255 20.285117 16.19395 12.37662
(Overhead) 8.957755 9.784722 5.699590 1.869518It is clearly that the synchronization overhead increases as the number of threads increases in the kernel 2.6.21. But the synchronization overhead actually decreases as the number of threads increases in the kernel 2.6.23.8 (We observed the same behavior on kernel 2.6.22 as well). This certainly is not a correct behavior. The kernels are configured with CONFIG_SMP, CONFIG_NUMA, CONFIG_SCHED_MC, CONFIG_PREEMPT_NONE, CONFIG_DISCONTIGMEM set. The complete kernel configuration file is in the attachment of this e-mail.
From what we have read, there was a new scheduler (CFS) appeared from 2.6.22. We are not sure whether the above behavior is caused by the new scheduler.
Finally, our machine cpu information is listed in the following:
processor : 0vendor_id : AuthenticAMD
cpu family : 16
model : 2
model name : Quad-Core AMD Opteron(tm) Processor 2347
stepping : 10
cpu MHz : 1909.801
cache size : 512 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 4
fpu : yesfpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp
lm 3dnowext 3dnow constant_tsc rep_good pni cx16 popcnt lahf_lmcmp_legacy svm
extapic cr8_legacy altmovcr8 abm sse4a misalignsse 3dnowprefetch osvw
bogomips : 3822.95
TLB size : 1024 4K pages
clflush size : 64cache_alignment : 64
address sizes : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate
In addition, we have schedstat and sched_debug files in the /proc directory.
Thank you for all your help to solve this puzzle. If you need more information, please let us know.
P.S. I like to be cc'ed on the discussions related to this problem.
###############################################
Jie Chen
Scientific Computing Group
Thomas Jefferson National Accelerator Facility
12000, Jefferson Ave.
Newport News, VA 23606
(757)269-5046 (office) (757)269-6248 (fax)
[email protected]
###############################################
CONFIG_X86_64=yCONFIG_64BIT=yCONFIG_X86=yCONFIG_GENERIC_TIME=yCONFIG_GENERIC_TIME_VSYSCALL=yCONFIG_GENERIC_CMOS_UPDATE=yCONFIG_ZONE_DMA32=yCONFIG_LOCKDEP_SUPPORT=yCONFIG_STACKTRACE_SUPPORT=yCONFIG_SEMAPHORE_SLEEPERS=yCONFIG_MMU=yCONFIG_ZONE_DMA=yCONFIG_RWSEM_GENERIC_SPINLOCK=yCONFIG_GENERIC_HWEIGHT=yCONFIG_GENERIC_CALIBRATE_DELAY=yCONFIG_X86_CMPXCHG=yCONFIG_EARLY_PRINTK=yCONFIG_GENERIC_ISA_DMA=yCONFIG_GENERIC_IOMAP=yCONFIG_ARCH_MAY_HAVE_PC_FDC=yCONFIG_ARCH_POPULATES_NODE_MAP=yCONFIG_DMI=yCONFIG_AUDIT_ARCH=yCONFIG_GENERIC_BUG=yCONFIG_EXPERIMENTAL=yCONFIG_LOCK_KERNEL=yCONFIG_SWAP=yCONFIG_SYSVIPC=yCONFIG_SYSVIPC_SYSCTL=yCONFIG_POSIX_MQUEUE=yCONFIG_BSD_PROCESS_ACCT=yCONFIG_AUDIT=yCONFIG_AUDITSYSCALL=yCONFIG_IKCONFIG=mCONFIG_IKCONFIG_PROC=yCONFIG_CPUSETS=yCONFIG_SYSFS_DEPRECATED=yCONFIG_RELAY=yCONFIG_BLK_DEV_INITRD=yCONFIG_SYSCTL=yCONFIG_UID16=yCONFIG_SYSCTL_SYSCALL=yCONFIG_KALLSYMS=yCONFIG_KALLSYMS_EXTRA_PASS=yCONFIG_HOTPLUG=yCONFIG_PRINTK=yCONFIG_BUG=yCONFIG_ELF_CORE=yCONFIG_BASE_FULL=yCONFIG_FUTEX=yCONFIG_ANON_INODES=yCONFIG_EPOLL=yCONFIG_SIGNALFD=yCONFIG_EVENTFD=yCONFIG_SHMEM=yCONFIG_VM_EVENT_COUNTERS=yCONFIG_SLAB=yCONFIG_RT_MUTEXES=yCONFIG_MODULES=yCONFIG_MODULE_UNLOAD=yCONFIG_MODVERSIONS=yCONFIG_MODULE_SRCVERSION_ALL=yCONFIG_KMOD=yCONFIG_STOP_MACHINE=yCONFIG_BLOCK=yCONFIG_BLK_DEV_IO_TRACE=yCONFIG_IOSCHED_NOOP=yCONFIG_IOSCHED_AS=yCONFIG_IOSCHED_DEADLINE=yCONFIG_IOSCHED_CFQ=yCONFIG_DEFAULT_CFQ=yCONFIG_X86_PC=yCONFIG_MK8=yCONFIG_X86_TSC=yCONFIG_X86_GOOD_APIC=yCONFIG_MICROCODE=mCONFIG_MICROCODE_OLD_INTERFACE=yCONFIG_X86_MSR=yCONFIG_X86_CPUID=yCONFIG_X86_IO_APIC=yCONFIG_X86_LOCAL_APIC=yCONFIG_MTRR=yCONFIG_SMP=yCONFIG_SCHED_MC=yCONFIG_PREEMPT_NONE=yCONFIG_NUMA=yCONFIG_K8_NUMA=yCONFIG_X86_64_ACPI_NUMA=yCONFIG_ARCH_DISCONTIGMEM_ENABLE=yCONFIG_ARCH_DISCONTIGMEM_DEFAULT=yCONFIG_ARCH_SPARSEMEM_ENABLE=yCONFIG_SELECT_MEMORY_MODEL=yCONFIG_DISCONTIGMEM_MANUAL=yCONFIG_DISCONTIGMEM=yCONFIG_FLAT_NODE_MEM_MAP=yCONFIG_NEED_MULTIPLE_NODES=yCONFIG_MIGRATION=yCONFIG_RESOURCES_64BIT=yCONFIG_BOUNCE=yCONFIG_VIRT_TO_BUS=yCONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=yCONFIG_OUT_OF_LINE_PFN_TO_PAGE=yCONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=yCONFIG_HPET_TIMER=yCONFIG_HPET_EMULATE_RTC=yCONFIG_IOMMU=yCONFIG_SWIOTLB=yCONFIG_X86_MCE=yCONFIG_X86_MCE_AMD=yCONFIG_KEXEC=yCONFIG_HZ_100=yCONFIG_K8_NB=yCONFIG_GENERIC_HARDIRQS=yCONFIG_GENERIC_IRQ_PROBE=yCONFIG_ISA_DMA_API=yCONFIG_GENERIC_PENDING_IRQ=yCONFIG_PM=yCONFIG_SUSPEND_SMP_POSSIBLE=yCONFIG_HIBERNATION_SMP_POSSIBLE=yCONFIG_ACPI=yCONFIG_ACPI_PROCFS=yCONFIG_ACPI_PROC_EVENT=yCONFIG_ACPI_AC=mCONFIG_ACPI_BATTERY=mCONFIG_ACPI_BUTTON=mCONFIG_ACPI_VIDEO=mCONFIG_ACPI_FAN=yCONFIG_ACPI_DOCK=mCONFIG_ACPI_PROCESSOR=yCONFIG_ACPI_THERMAL=yCONFIG_ACPI_NUMA=yCONFIG_ACPI_ASUS=mCONFIG_ACPI_EC=yCONFIG_ACPI_POWER=yCONFIG_ACPI_SYSTEM=yCONFIG_X86_PM_TIMER=yCONFIG_ACPI_CONTAINER=yCONFIG_PCI=yCONFIG_PCI_DIRECT=yCONFIG_PCI_MMCONFIG=yCONFIG_PCIEPORTBUS=yCONFIG_HOTPLUG_PCI_PCIE=mCONFIG_PCIEAER=yCONFIG_ARCH_SUPPORTS_MSI=yCONFIG_PCI_MSI=yCONFIG_HT_IRQ=yCONFIG_HOTPLUG_PCI=yCONFIG_HOTPLUG_PCI_FAKE=mCONFIG_HOTPLUG_PCI_ACPI=mCONFIG_HOTPLUG_PCI_ACPI_IBM=mCONFIG_HOTPLUG_PCI_SHPC=mCONFIG_BINFMT_ELF=yCONFIG_BINFMT_MISC=yCONFIG_IA32_EMULATION=yCONFIG_COMPAT=yCONFIG_COMPAT_FOR_U64_ALIGNMENT=yCONFIG_SYSVIPC_COMPAT=yCONFIG_NET=yCONFIG_PACKET=yCONFIG_UNIX=yCONFIG_XFRM=yCONFIG_XFRM_USER=yCONFIG_NET_KEY=mCONFIG_INET=yCONFIG_IP_MULTICAST=yCONFIG_IP_FIB_HASH=yCONFIG_INET_XFRM_MODE_BEET=yCONFIG_INET_DIAG=mCONFIG_INET_TCP_DIAG=mCONFIG_TCP_CONG_CUBIC=yCONFIG_NETWORK_SECMARK=yCONFIG_BRIDGE=mCONFIG_VLAN_8021Q=mCONFIG_LLC=mCONFIG_NET_PKTGEN=mCONFIG_IRDA=mCONFIG_IRLAN=mCONFIG_IRCOMM=mCONFIG_IRDA_CACHE_LAST_LSAP=yCONFIG_IRDA_FAST_RR=yCONFIG_IRTTY_SIR=mCONFIG_DONGLE=yCONFIG_ESI_DONGLE=mCONFIG_ACTISYS_DONGLE=mCONFIG_TEKRAM_DONGLE=mCONFIG_TOIM3232_DONGLE=mCONFIG_LITELINK_DONGLE=mCONFIG_MA600_DONGLE=mCONFIG_GIRBIL_DONGLE=mCONFIG_MCP2120_DONGLE=mCONFIG_OLD_BELKIN_DONGLE=mCONFIG_ACT200L_DONGLE=mCONFIG_USB_IRDA=mCONFIG_SIGMATEL_FIR=mCONFIG_NSC_FIR=mCONFIG_WINBOND_FIR=mCONFIG_SMC_IRCC_FIR=mCONFIG_ALI_FIR=mCONFIG_VLSI_FIR=mCONFIG_VIA_FIR=mCONFIG_MCS_FIR=mCONFIG_BT=mCONFIG_BT_L2CAP=mCONFIG_BT_SCO=mCONFIG_BT_RFCOMM=mCONFIG_BT_RFCOMM_TTY=yCONFIG_BT_BNEP=mCONFIG_BT_BNEP_MC_FILTER=yCONFIG_BT_BNEP_PROTO_FILTER=yCONFIG_BT_HIDP=mCONFIG_BT_HCIUSB=mCONFIG_BT_HCIUSB_SCO=yCONFIG_BT_HCIUART=mCONFIG_BT_HCIUART_H4=yCONFIG_BT_HCIUART_BCSP=yCONFIG_BT_HCIBCM203X=mCONFIG_BT_HCIBPA10X=mCONFIG_BT_HCIBFUSB=mCONFIG_BT_HCIVHCI=mCONFIG_WIRELESS_EXT=yCONFIG_IEEE80211=mCONFIG_IEEE80211_CRYPT_WEP=mCONFIG_IEEE80211_CRYPT_CCMP=mCONFIG_IEEE80211_SOFTMAC=mCONFIG_IEEE80211_SOFTMAC_DEBUG=yCONFIG_STANDALONE=yCONFIG_PREVENT_FIRMWARE_BUILD=yCONFIG_FW_LOADER=yCONFIG_CONNECTOR=yCONFIG_PROC_EVENTS=yCONFIG_PARPORT=mCONFIG_PARPORT_PC=mCONFIG_PARPORT_SERIAL=mCONFIG_PARPORT_NOT_PC=yCONFIG_PNP=yCONFIG_PNPACPI=yCONFIG_BLK_DEV=yCONFIG_BLK_DEV_FD=mCONFIG_BLK_DEV_LOOP=mCONFIG_BLK_DEV_CRYPTOLOOP=mCONFIG_BLK_DEV_NBD=mCONFIG_BLK_DEV_SX8=mCONFIG_BLK_DEV_UB=mCONFIG_BLK_DEV_RAM=yCONFIG_MISC_DEVICES=yCONFIG_IDE=yCONFIG_BLK_DEV_IDE=yCONFIG_BLK_DEV_IDEDISK=yCONFIG_IDEDISK_MULTI_MODE=yCONFIG_BLK_DEV_IDECD=mCONFIG_BLK_DEV_IDEFLOPPY=yCONFIG_BLK_DEV_IDESCSI=mCONFIG_IDE_TASK_IOCTL=yCONFIG_IDE_PROC_FS=yCONFIG_IDE_GENERIC=yCONFIG_BLK_DEV_IDEPNP=yCONFIG_BLK_DEV_IDEPCI=yCONFIG_IDEPCI_SHARE_IRQ=yCONFIG_IDEPCI_PCIBUS_ORDER=yCONFIG_BLK_DEV_GENERIC=yCONFIG_BLK_DEV_IDEDMA_PCI=yCONFIG_BLK_DEV_AEC62XX=yCONFIG_BLK_DEV_ALI15X3=yCONFIG_BLK_DEV_AMD74XX=yCONFIG_BLK_DEV_ATIIXP=yCONFIG_BLK_DEV_CMD64X=yCONFIG_BLK_DEV_HPT34X=yCONFIG_BLK_DEV_HPT366=yCONFIG_BLK_DEV_PIIX=yCONFIG_BLK_DEV_IT821X=yCONFIG_BLK_DEV_PDC202XX_OLD=yCONFIG_BLK_DEV_PDC202XX_NEW=yCONFIG_BLK_DEV_SVWKS=yCONFIG_BLK_DEV_SIIMAGE=yCONFIG_BLK_DEV_SIS5513=yCONFIG_BLK_DEV_VIA82CXXX=yCONFIG_BLK_DEV_IDEDMA=yCONFIG_RAID_ATTRS=mCONFIG_SCSI=mCONFIG_SCSI_DMA=yCONFIG_SCSI_NETLINK=yCONFIG_SCSI_PROC_FS=yCONFIG_BLK_DEV_SD=mCONFIG_CHR_DEV_ST=mCONFIG_CHR_DEV_OSST=mCONFIG_BLK_DEV_SR=mCONFIG_BLK_DEV_SR_VENDOR=yCONFIG_CHR_DEV_SG=mCONFIG_CHR_DEV_SCH=mCONFIG_SCSI_MULTI_LUN=yCONFIG_SCSI_CONSTANTS=yCONFIG_SCSI_LOGGING=yCONFIG_SCSI_WAIT_SCAN=mCONFIG_SCSI_SPI_ATTRS=mCONFIG_SCSI_FC_ATTRS=mCONFIG_SCSI_ISCSI_ATTRS=mCONFIG_SCSI_SAS_ATTRS=mCONFIG_SCSI_LOWLEVEL=yCONFIG_ISCSI_TCP=mCONFIG_BLK_DEV_3W_XXXX_RAID=mCONFIG_SCSI_3W_9XXX=mCONFIG_SCSI_ACARD=mCONFIG_SCSI_AACRAID=mCONFIG_SCSI_AIC7XXX=mCONFIG_SCSI_AIC7XXX_OLD=mCONFIG_SCSI_AIC79XX=mCONFIG_MEGARAID_NEWGEN=yCONFIG_MEGARAID_MM=mCONFIG_MEGARAID_MAILBOX=mCONFIG_MEGARAID_LEGACY=mCONFIG_MEGARAID_SAS=mCONFIG_SCSI_HPTIOP=mCONFIG_SCSI_BUSLOGIC=mCONFIG_SCSI_GDTH=mCONFIG_SCSI_IPS=mCONFIG_SCSI_INITIO=mCONFIG_SCSI_INIA100=mCONFIG_SCSI_PPA=mCONFIG_SCSI_IMM=mCONFIG_SCSI_SYM53C8XX_2=mCONFIG_SCSI_SYM53C8XX_MMIO=yCONFIG_SCSI_QLOGIC_1280=mCONFIG_SCSI_QLA_FC=mCONFIG_SCSI_LPFC=m
CONFIG_SCSI_DC395x=mCONFIG_SCSI_DC390T=mCONFIG_ATA=mCONFIG_ATA_ACPI=yCONFIG_SATA_SVW=mCONFIG_ATA_PIIX=mCONFIG_SATA_NV=mCONFIG_PDC_ADMA=mCONFIG_SATA_QSTOR=mCONFIG_SATA_PROMISE=mCONFIG_SATA_SX4=mCONFIG_SATA_SIL=mCONFIG_SATA_SIL24=mCONFIG_SATA_SIS=mCONFIG_SATA_ULI=mCONFIG_SATA_VIA=mCONFIG_SATA_VITESSE=mCONFIG_PATA_AMD=mCONFIG_PATA_ATIIXP=mCONFIG_PATA_CS5520=mCONFIG_PATA_EFAR=mCONFIG_ATA_GENERIC=mCONFIG_PATA_IT821X=mCONFIG_PATA_JMICRON=mCONFIG_PATA_TRIFLEX=mCONFIG_PATA_MPIIX=mCONFIG_PATA_OLDPIIX=mCONFIG_PATA_NETCELL=mCONFIG_PATA_RZ1000=mCONFIG_PATA_SERVERWORKS=mCONFIG_PATA_PDC2027X=mCONFIG_PATA_SIL680=mCONFIG_PATA_SIS=mCONFIG_PATA_VIA=mCONFIG_PATA_WINBOND=mCONFIG_MD=yCONFIG_BLK_DEV_MD=yCONFIG_MD_LINEAR=mCONFIG_MD_RAID0=mCONFIG_MD_RAID1=mCONFIG_MD_RAID10=mCONFIG_MD_RAID456=mCONFIG_MD_RAID5_RESHAPE=yCONFIG_MD_MULTIPATH=mCONFIG_MD_FAULTY=mCONFIG_BLK_DEV_DM=mCONFIG_DM_CRYPT=mCONFIG_DM_SNAPSHOT=mCONFIG_DM_MIRROR=mCONFIG_DM_ZERO=mCONFIG_DM_MULTIPATH=mCONFIG_DM_MULTIPATH_EMC=mCONFIG_FUSION=yCONFIG_FUSION_SPI=mCONFIG_FUSION_FC=mCONFIG_FUSION_SAS=mCONFIG_FUSION_CTL=mCONFIG_NETDEVICES=yCONFIG_DUMMY=mCONFIG_BONDING=mCONFIG_EQUALIZER=mCONFIG_TUN=mCONFIG_PHYLIB=mCONFIG_MARVELL_PHY=mCONFIG_DAVICOM_PHY=mCONFIG_QSEMI_PHY=mCONFIG_LXT_PHY=mCONFIG_CICADA_PHY=mCONFIG_VITESSE_PHY=mCONFIG_SMSC_PHY=mCONFIG_FIXED_PHY=mCONFIG_FIXED_MII_10_FDX=yCONFIG_FIXED_MII_100_FDX=yCONFIG_NET_ETHERNET=yCONFIG_MII=mCONFIG_NET_VENDOR_3COM=yCONFIG_VORTEX=mCONFIG_TYPHOON=mCONFIG_NET_PCI=yCONFIG_PCNET32=mCONFIG_AMD8111_ETH=mCONFIG_AMD8111E_NAPI=yCONFIG_B44=mCONFIG_FORCEDETH=mCONFIG_E100=mCONFIG_EPIC100=mCONFIG_SUNDANCE=mCONFIG_VIA_RHINE=mCONFIG_VIA_RHINE_MMIO=yCONFIG_VIA_RHINE_NAPI=yCONFIG_NETDEV_1000=yCONFIG_ACENIC=mCONFIG_DL2K=mCONFIG_E1000=mCONFIG_E1000_NAPI=yCONFIG_NS83820=mCONFIG_HAMACHI=mCONFIG_YELLOWFIN=mCONFIG_R8169=mCONFIG_R8169_NAPI=yCONFIG_R8169_VLAN=yCONFIG_SIS190=mCONFIG_SKGE=mCONFIG_SKY2=mCONFIG_VIA_VELOCITY=mCONFIG_TIGON3=mCONFIG_BNX2=mCONFIG_NETDEV_10000=yCONFIG_CHELSIO_T1=mCONFIG_CHELSIO_T1_NAPI=yCONFIG_IXGB=mCONFIG_IXGB_NAPI=yCONFIG_S2IO=mCONFIG_S2IO_NAPI=yCONFIG_MYRI10GE=mCONFIG_MLX4_CORE=mCONFIG_MLX4_DEBUG=yCONFIG_NETCONSOLE=mCONFIG_NETPOLL=yCONFIG_NETPOLL_TRAP=yCONFIG_NET_POLL_CONTROLLER=yCONFIG_INPUT=yCONFIG_INPUT_FF_MEMLESS=yCONFIG_INPUT_MOUSEDEV=yCONFIG_INPUT_EVDEV=yCONFIG_INPUT_KEYBOARD=yCONFIG_KEYBOARD_ATKBD=yCONFIG_INPUT_MOUSE=yCONFIG_MOUSE_PS2=yCONFIG_MOUSE_PS2_ALPS=yCONFIG_MOUSE_PS2_LOGIPS2PP=yCONFIG_MOUSE_PS2_SYNAPTICS=yCONFIG_MOUSE_PS2_LIFEBOOK=yCONFIG_MOUSE_PS2_TRACKPOINT=yCONFIG_MOUSE_SERIAL=mCONFIG_MOUSE_VSXXXAA=mCONFIG_INPUT_MISC=yCONFIG_INPUT_PCSPKR=mCONFIG_INPUT_UINPUT=mCONFIG_SERIO=yCONFIG_SERIO_I8042=yCONFIG_SERIO_SERPORT=yCONFIG_SERIO_LIBPS2=yCONFIG_SERIO_RAW=mCONFIG_VT=yCONFIG_VT_CONSOLE=yCONFIG_HW_CONSOLE=yCONFIG_VT_HW_CONSOLE_BINDING=yCONFIG_SERIAL_NONSTANDARD=yCONFIG_CYCLADES=mCONFIG_SYNCLINK=mCONFIG_SYNCLINKMP=mCONFIG_SYNCLINK_GT=mCONFIG_N_HDLC=mCONFIG_SERIAL_8250=yCONFIG_SERIAL_8250_CONSOLE=yCONFIG_FIX_EARLYCON_MEM=yCONFIG_SERIAL_8250_PCI=yCONFIG_SERIAL_8250_PNP=yCONFIG_SERIAL_8250_EXTENDED=yCONFIG_SERIAL_8250_MANY_PORTS=yCONFIG_SERIAL_8250_SHARE_IRQ=yCONFIG_SERIAL_8250_DETECT_IRQ=yCONFIG_SERIAL_8250_RSA=yCONFIG_SERIAL_CORE=yCONFIG_SERIAL_CORE_CONSOLE=yCONFIG_SERIAL_JSM=mCONFIG_UNIX98_PTYS=yCONFIG_PRINTER=mCONFIG_LP_CONSOLE=yCONFIG_PPDEV=mCONFIG_TIPAR=mCONFIG_WATCHDOG=yCONFIG_SOFT_WATCHDOG=mCONFIG_SC520_WDT=mCONFIG_I6300ESB_WDT=mCONFIG_W83627HF_WDT=mCONFIG_W83877F_WDT=mCONFIG_W83977F_WDT=mCONFIG_MACHZ_WDT=mCONFIG_PCIPCWATCHDOG=mCONFIG_WDTPCI=mCONFIG_WDT_501_PCI=yCONFIG_USBPCWATCHDOG=mCONFIG_HW_RANDOM=yCONFIG_HW_RANDOM_INTEL=mCONFIG_HW_RANDOM_AMD=mCONFIG_NVRAM=yCONFIG_RTC=yCONFIG_R3964=mCONFIG_AGP=yCONFIG_AGP_AMD64=yCONFIG_AGP_INTEL=yCONFIG_AGP_SIS=yCONFIG_AGP_VIA=yCONFIG_MWAVE=m
CONFIG_PC8736x_GPIO=mCONFIG_NSC_GPIO=mCONFIG_HPET=yCONFIG_HANGCHECK_TIMER=mCONFIG_DEVPORT=yCONFIG_I2C=mCONFIG_I2C_BOARDINFO=yCONFIG_I2C_CHARDEV=mCONFIG_I2C_ALGOBIT=mCONFIG_I2C_ALGOPCF=mCONFIG_I2C_ALGOPCA=mCONFIG_I2C_ALI1535=mCONFIG_I2C_ALI1563=mCONFIG_I2C_ALI15X3=mCONFIG_I2C_AMD756=mCONFIG_I2C_AMD756_S4882=mCONFIG_I2C_AMD8111=mCONFIG_I2C_I801=mCONFIG_I2C_I810=mCONFIG_I2C_PIIX4=mCONFIG_I2C_NFORCE2=mCONFIG_I2C_OCORES=mCONFIG_I2C_PARPORT=mCONFIG_I2C_PARPORT_LIGHT=mCONFIG_I2C_PROSAVAGE=mCONFIG_I2C_SAVAGE4=mCONFIG_I2C_SIS5595=mCONFIG_I2C_SIS630=mCONFIG_I2C_SIS96X=mCONFIG_I2C_STUB=mCONFIG_I2C_VIA=mCONFIG_I2C_VIAPRO=mCONFIG_I2C_VOODOO3=mCONFIG_SENSORS_DS1337=mCONFIG_SENSORS_DS1374=mCONFIG_SENSORS_EEPROM=mCONFIG_SENSORS_PCF8574=mCONFIG_SENSORS_PCA9539=mCONFIG_SENSORS_PCF8591=mCONFIG_SENSORS_MAX6875=mCONFIG_HWMON=mCONFIG_HWMON_VID=mCONFIG_SENSORS_ABITUGURU=mCONFIG_SENSORS_ADM1021=mCONFIG_SENSORS_ADM1025=mCONFIG_SENSORS_ADM1026=mCONFIG_SENSORS_ADM1031=mCONFIG_SENSORS_ADM9240=mCONFIG_SENSORS_ASB100=mCONFIG_SENSORS_ATXP1=mCONFIG_SENSORS_DS1621=mCONFIG_SENSORS_F71805F=mCONFIG_SENSORS_FSCHER=mCONFIG_SENSORS_FSCPOS=mCONFIG_SENSORS_GL518SM=mCONFIG_SENSORS_GL520SM=mCONFIG_SENSORS_IT87=mCONFIG_SENSORS_LM63=mCONFIG_SENSORS_LM75=mCONFIG_SENSORS_LM77=mCONFIG_SENSORS_LM78=mCONFIG_SENSORS_LM80=mCONFIG_SENSORS_LM83=mCONFIG_SENSORS_LM85=mCONFIG_SENSORS_LM87=mCONFIG_SENSORS_LM90=mCONFIG_SENSORS_LM92=mCONFIG_SENSORS_MAX1619=mCONFIG_SENSORS_PC87360=mCONFIG_SENSORS_SIS5595=mCONFIG_SENSORS_SMSC47M1=mCONFIG_SENSORS_SMSC47M192=mCONFIG_SENSORS_SMSC47B397=mCONFIG_SENSORS_VIA686A=mCONFIG_SENSORS_VT8231=mCONFIG_SENSORS_W83781D=mCONFIG_SENSORS_W83791D=mCONFIG_SENSORS_W83792D=mCONFIG_SENSORS_W83L785TS=mCONFIG_SENSORS_W83627HF=mCONFIG_SENSORS_W83627EHF=mCONFIG_SENSORS_HDAPS=mCONFIG_VIDEO_DEV=mCONFIG_VIDEO_V4L1=yCONFIG_VIDEO_V4L1_COMPAT=yCONFIG_VIDEO_V4L2=yCONFIG_VIDEO_CAPTURE_DRIVERS=yCONFIG_VIDEO_HELPER_CHIPS_AUTO=yCONFIG_V4L_USB_DRIVERS=yCONFIG_RADIO_ADAPTERS=yCONFIG_DAB=yCONFIG_BACKLIGHT_LCD_SUPPORT=yCONFIG_BACKLIGHT_CLASS_DEVICE=mCONFIG_VIDEO_OUTPUT_CONTROL=mCONFIG_VGA_CONSOLE=yCONFIG_VGACON_SOFT_SCROLLBACK=yCONFIG_VIDEO_SELECT=yCONFIG_DUMMY_CONSOLE=y
CONFIG_FONT_8x16=yCONFIG_HID_SUPPORT=yCONFIG_HID=yCONFIG_USB_HID=yCONFIG_HID_FF=yCONFIG_HID_PID=yCONFIG_LOGITECH_FF=yCONFIG_THRUSTMASTER_FF=yCONFIG_USB_HIDDEV=yCONFIG_USB_SUPPORT=yCONFIG_USB_ARCH_HAS_HCD=yCONFIG_USB_ARCH_HAS_OHCI=yCONFIG_USB_ARCH_HAS_EHCI=yCONFIG_USB=yCONFIG_USB_DEVICEFS=yCONFIG_USB_DEVICE_CLASS=yCONFIG_USB_EHCI_HCD=mCONFIG_USB_EHCI_SPLIT_ISO=yCONFIG_USB_EHCI_ROOT_HUB_TT=yCONFIG_USB_EHCI_TT_NEWSCHED=yCONFIG_USB_ISP116X_HCD=mCONFIG_USB_OHCI_HCD=mCONFIG_USB_OHCI_LITTLE_ENDIAN=yCONFIG_USB_UHCI_HCD=mCONFIG_USB_SL811_HCD=mCONFIG_USB_ACM=mCONFIG_USB_PRINTER=mCONFIG_USB_STORAGE=mCONFIG_USB_STORAGE_DATAFAB=yCONFIG_USB_STORAGE_FREECOM=yCONFIG_USB_STORAGE_ISD200=yCONFIG_USB_STORAGE_DPCM=yCONFIG_USB_STORAGE_USBAT=yCONFIG_USB_STORAGE_SDDR09=yCONFIG_USB_STORAGE_SDDR55=yCONFIG_USB_STORAGE_JUMPSHOT=yCONFIG_USB_STORAGE_ALAUDA=yCONFIG_USB_LIBUSUAL=yCONFIG_USB_MDC800=mCONFIG_USB_MICROTEK=mCONFIG_USB_MON=yCONFIG_USB_USS720=mCONFIG_USB_SERIAL=mCONFIG_USB_SERIAL_GENERIC=yCONFIG_USB_SERIAL_AIRPRIME=mCONFIG_USB_SERIAL_ARK3116=mCONFIG_USB_SERIAL_BELKIN=mCONFIG_USB_SERIAL_WHITEHEAT=mCONFIG_USB_SERIAL_DIGI_ACCELEPORT=mCONFIG_USB_SERIAL_CP2101=mCONFIG_USB_SERIAL_CYPRESS_M8=mCONFIG_USB_SERIAL_EMPEG=mCONFIG_USB_SERIAL_FTDI_SIO=mCONFIG_USB_SERIAL_FUNSOFT=mCONFIG_USB_SERIAL_VISOR=mCONFIG_USB_SERIAL_IPAQ=mCONFIG_USB_SERIAL_IR=mCONFIG_USB_SERIAL_EDGEPORT=mCONFIG_USB_SERIAL_EDGEPORT_TI=mCONFIG_USB_SERIAL_GARMIN=mCONFIG_USB_SERIAL_IPW=mCONFIG_USB_SERIAL_KEYSPAN_PDA=mCONFIG_USB_SERIAL_KEYSPAN=mCONFIG_USB_SERIAL_KEYSPAN_MPR=yCONFIG_USB_SERIAL_KEYSPAN_USA28=yCONFIG_USB_SERIAL_KEYSPAN_USA28X=yCONFIG_USB_SERIAL_KEYSPAN_USA28XA=yCONFIG_USB_SERIAL_KEYSPAN_USA28XB=yCONFIG_USB_SERIAL_KEYSPAN_USA19=yCONFIG_USB_SERIAL_KEYSPAN_USA18X=yCONFIG_USB_SERIAL_KEYSPAN_USA19W=yCONFIG_USB_SERIAL_KEYSPAN_USA19QW=yCONFIG_USB_SERIAL_KEYSPAN_USA19QI=yCONFIG_USB_SERIAL_KEYSPAN_USA49W=yCONFIG_USB_SERIAL_KEYSPAN_USA49WLC=yCONFIG_USB_SERIAL_KLSI=mCONFIG_USB_SERIAL_KOBIL_SCT=mCONFIG_USB_SERIAL_MCT_U232=mCONFIG_USB_SERIAL_NAVMAN=mCONFIG_USB_SERIAL_PL2303=mCONFIG_USB_SERIAL_HP4X=mCONFIG_USB_SERIAL_SAFE=mCONFIG_USB_SERIAL_SAFE_PADDED=yCONFIG_USB_SERIAL_SIERRAWIRELESS=mCONFIG_USB_SERIAL_TI=mCONFIG_USB_SERIAL_CYBERJACK=mCONFIG_USB_SERIAL_XIRCOM=mCONFIG_USB_SERIAL_OPTION=mCONFIG_USB_SERIAL_OMNINET=mCONFIG_USB_EZUSB=yCONFIG_USB_EMI62=mCONFIG_USB_EMI26=mCONFIG_USB_AUERSWALD=mCONFIG_USB_RIO500=mCONFIG_USB_LEGOTOWER=mCONFIG_USB_LCD=mCONFIG_USB_LED=mCONFIG_USB_IDMOUSE=mCONFIG_USB_APPLEDISPLAY=mCONFIG_USB_SISUSBVGA=mCONFIG_USB_SISUSBVGA_CON=yCONFIG_USB_LD=mCONFIG_USB_TEST=mCONFIG_INFINIBAND=mCONFIG_INFINIBAND_USER_MAD=mCONFIG_INFINIBAND_USER_ACCESS=mCONFIG_INFINIBAND_USER_MEM=yCONFIG_INFINIBAND_ADDR_TRANS=yCONFIG_INFINIBAND_MTHCA=mCONFIG_INFINIBAND_MTHCA_DEBUG=yCONFIG_INFINIBAND_IPATH=mCONFIG_INFINIBAND_AMSO1100=mCONFIG_MLX4_INFINIBAND=mCONFIG_INFINIBAND_IPOIB=mCONFIG_INFINIBAND_IPOIB_DEBUG=yCONFIG_INFINIBAND_IPOIB_DEBUG_DATA=yCONFIG_INFINIBAND_SRP=mCONFIG_INFINIBAND_ISER=mCONFIG_DMA_ENGINE=yCONFIG_NET_DMA=yCONFIG_INTEL_IOATDMA=mCONFIG_VIRTUALIZATION=yCONFIG_EDD=mCONFIG_DELL_RBU=mCONFIG_DCDBAS=mCONFIG_DMIID=yCONFIG_EXT2_FS=yCONFIG_EXT2_FS_XATTR=yCONFIG_EXT2_FS_POSIX_ACL=yCONFIG_EXT2_FS_SECURITY=yCONFIG_EXT2_FS_XIP=yCONFIG_FS_XIP=yCONFIG_EXT3_FS=mCONFIG_EXT3_FS_XATTR=yCONFIG_EXT3_FS_POSIX_ACL=yCONFIG_EXT3_FS_SECURITY=yCONFIG_JBD=mCONFIG_FS_MBCACHE=yCONFIG_REISERFS_FS=mCONFIG_REISERFS_PROC_INFO=yCONFIG_REISERFS_FS_XATTR=yCONFIG_REISERFS_FS_POSIX_ACL=yCONFIG_REISERFS_FS_SECURITY=yCONFIG_JFS_FS=mCONFIG_JFS_POSIX_ACL=yCONFIG_JFS_SECURITY=yCONFIG_FS_POSIX_ACL=yCONFIG_XFS_FS=mCONFIG_XFS_QUOTA=yCONFIG_XFS_SECURITY=yCONFIG_XFS_POSIX_ACL=yCONFIG_OCFS2_FS=mCONFIG_ROMFS_FS=mCONFIG_INOTIFY=yCONFIG_INOTIFY_USER=yCONFIG_QUOTA=yCONFIG_QFMT_V2=yCONFIG_QUOTACTL=yCONFIG_DNOTIFY=yCONFIG_AUTOFS_FS=mCONFIG_AUTOFS4_FS=mCONFIG_FUSE_FS=mCONFIG_ISO9660_FS=yCONFIG_JOLIET=yCONFIG_ZISOFS=yCONFIG_UDF_FS=mCONFIG_UDF_NLS=yCONFIG_FAT_FS=mCONFIG_MSDOS_FS=mCONFIG_VFAT_FS=mCONFIG_NTFS_FS=mCONFIG_NTFS_RW=yCONFIG_PROC_FS=yCONFIG_PROC_KCORE=yCONFIG_PROC_SYSCTL=yCONFIG_SYSFS=yCONFIG_TMPFS=yCONFIG_HUGETLBFS=yCONFIG_HUGETLB_PAGE=yCONFIG_RAMFS=yCONFIG_CONFIGFS_FS=mCONFIG_UFS_FS=mCONFIG_NFS_FS=mCONFIG_NFS_V3=yCONFIG_NFS_V3_ACL=yCONFIG_NFS_V4=yCONFIG_NFS_DIRECTIO=yCONFIG_NFSD=mCONFIG_NFSD_V2_ACL=yCONFIG_NFSD_V3=yCONFIG_NFSD_V3_ACL=yCONFIG_NFSD_V4=yCONFIG_NFSD_TCP=yCONFIG_LOCKD=mCONFIG_LOCKD_V4=yCONFIG_EXPORTFS=mCONFIG_NFS_ACL_SUPPORT=mCONFIG_NFS_COMMON=yCONFIG_SUNRPC=mCONFIG_SUNRPC_GSS=mCONFIG_RPCSEC_GSS_KRB5=mCONFIG_CIFS=mCONFIG_CIFS_WEAK_PW_HASH=yCONFIG_CIFS_XATTR=yCONFIG_CIFS_POSIX=yCONFIG_CODA_FS=mCONFIG_PARTITION_ADVANCED=yCONFIG_MAC_PARTITION=yCONFIG_MSDOS_PARTITION=yCONFIG_BSD_DISKLABEL=yCONFIG_MINIX_SUBPARTITION=yCONFIG_SOLARIS_X86_PARTITION=yCONFIG_UNIXWARE_DISKLABEL=yCONFIG_SGI_PARTITION=yCONFIG_SUN_PARTITION=yCONFIG_NLS=yCONFIG_NLS_CODEPAGE_437=yCONFIG_NLS_CODEPAGE_936=mCONFIG_NLS_CODEPAGE_950=mCONFIG_NLS_ASCII=yCONFIG_NLS_ISO8859_1=mCONFIG_NLS_UTF8=mCONFIG_PROFILING=yCONFIG_OPROFILE=mCONFIG_KPROBES=yCONFIG_TRACE_IRQFLAGS_SUPPORT=yCONFIG_ENABLE_MUST_CHECK=yCONFIG_MAGIC_SYSRQ=yCONFIG_DEBUG_FS=yCONFIG_DEBUG_KERNEL=yCONFIG_DETECT_SOFTLOCKUP=yCONFIG_SCHED_DEBUG=yCONFIG_SCHEDSTATS=yCONFIG_DEBUG_SPINLOCK=yCONFIG_DEBUG_SPINLOCK_SLEEP=yCONFIG_DEBUG_BUGVERBOSE=yCONFIG_DEBUG_INFO=yCONFIG_DEBUG_RODATA=yCONFIG_DEBUG_STACKOVERFLOW=yCONFIG_KEYS=yCONFIG_KEYS_DEBUG_PROC_KEYS=yCONFIG_SECURITY=yCONFIG_SECURITY_NETWORK=yCONFIG_SECURITY_CAPABILITIES=yCONFIG_XOR_BLOCKS=mCONFIG_ASYNC_CORE=mCONFIG_ASYNC_MEMCPY=mCONFIG_ASYNC_XOR=mCONFIG_CRYPTO=yCONFIG_CRYPTO_ALGAPI=yCONFIG_CRYPTO_BLKCIPHER=mCONFIG_CRYPTO_HASH=yCONFIG_CRYPTO_MANAGER=yCONFIG_CRYPTO_HMAC=yCONFIG_CRYPTO_NULL=mCONFIG_CRYPTO_MD4=mCONFIG_CRYPTO_MD5=mCONFIG_CRYPTO_SHA1=yCONFIG_CRYPTO_SHA256=mCONFIG_CRYPTO_SHA512=mCONFIG_CRYPTO_WP512=mCONFIG_CRYPTO_TGR192=mCONFIG_CRYPTO_ECB=mCONFIG_CRYPTO_CBC=mCONFIG_CRYPTO_PCBC=mCONFIG_CRYPTO_DES=mCONFIG_CRYPTO_BLOWFISH=mCONFIG_CRYPTO_TWOFISH=mCONFIG_CRYPTO_TWOFISH_COMMON=mCONFIG_CRYPTO_SERPENT=mCONFIG_CRYPTO_AES=mCONFIG_CRYPTO_AES_X86_64=mCONFIG_CRYPTO_CAST5=mCONFIG_CRYPTO_CAST6=mCONFIG_CRYPTO_TEA=mCONFIG_CRYPTO_ARC4=mCONFIG_CRYPTO_KHAZAD=mCONFIG_CRYPTO_ANUBIS=mCONFIG_CRYPTO_DEFLATE=mCONFIG_CRYPTO_MICHAEL_MIC=mCONFIG_CRYPTO_CRC32C=yCONFIG_CRYPTO_HW=yCONFIG_BITREVERSE=yCONFIG_CRC_CCITT=mCONFIG_CRC16=mCONFIG_CRC32=yCONFIG_LIBCRC32C=yCONFIG_ZLIB_INFLATE=yCONFIG_ZLIB_DEFLATE=mCONFIG_PLIST=yCONFIG_HAS_IOMEM=yCONFIG_HAS_IOPORT=yCONFIG_HAS_DMA=y
Quoted 4 lines · Jie Chen
Hi, there:
We have a simple pthread program that measures the synchronization
overheads for various synchronization mechanisms such as spin locks, barriers (the barrier is implemented using queue-based barrier algorithm) and so on. We have dual quad-core AMD opterons (barcelona) clusters running 2.6.23.8 kernel at this moment using Fedora Core 7 distribution. Before we moved to this kernel, we had kernel 2.6.21. These two kernels are configured identical and compiled with the same gcc 4.1.2 compiler. Under the old kernel, we observed that the performance of these overheads increases as the number of threads increases from 2 to 8. The following are the values of total time and overhead for all threads acquiring a pthread spin lock and all threads executing a barrier synchronization call.
Could you post the source of your test program ?
spinlock are ... spining and should not call linux scheduler, so I have no idea why a kernel change could modify your results.
Also I suspect you'll have better results with Fedora Core 8 (since glibc was updated to use private futexes in v 2.7), at least for the barrier ops.
Quoted 71 lines
Kernel 2.6.21
Number of Threads 2 4 6 8 SpinLock (Time micro second) 10.5618 10.58538 10.5915 10.643 (Overhead) 0.073 0.05746 0.102805 0.154563 Barrier (Time micro second) 11.020410 11.678125 11.9889 12.38002 (Overhead) 0.531660 1.1502 1.500112 1.891617Each thread is bound to a particular core using
pthread_setaffinity_np.Kernel 2.6.23.8
Number of Threads 2 4 6 8 SpinLock (Time micro second) 14.849915 17.117603 14.4496 10.5990 (Overhead) 4.345417 6.617207 3.949435 0.110985 Barrier (Time micro second) 19.462255 20.285117 16.19395 12.37662 (Overhead) 8.957755 9.784722 5.699590 1.869518It is clearly that the synchronization overhead increases as the number of threads increases in the kernel 2.6.21. But the synchronization overhead actually decreases as the number of threads increases in the kernel 2.6.23.8 (We observed the same behavior on kernel 2.6.22 as well). This certainly is not a correct behavior. The kernels are configured with
CONFIG_SMP,CONFIG_NUMA,CONFIG_SCHED_MC,CONFIG_PREEMPT_NONE,CONFIG_DISCONTIGMEMset. The complete kernel configuration file is in the attachment of this e-mail.From what we have read, there was a new scheduler (CFS) appeared from
2.6.22. We are not sure whether the above behavior is caused by the new scheduler.Finally, our machine cpu information is listed in the following:
processor : 0
vendor_id: AuthenticAMD
cpu family : 16
model : 2
model name : Quad-Core AMD Opteron(tm) Processor 2347
stepping : 10
cpu MHz : 1909.801
cache size : 512 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 4
fpu : yesfpu_exception: yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxextfxsr_optpdpe1gb rdtscp
lm 3dnowext 3dnowconstant_tscrep_goodpni cx16 popcntlahf_lmcmp_legacysvm
extapiccr8_legacyaltmovcr8 abm sse4a misalignsse 3dnowprefetch osvw
bogomips : 3822.95
TLB size : 1024 4K pages
clflush size : 64cache_alignment: 64
address sizes : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstateIn addition, we have schedstat and
sched_debugfiles in the /proc directory.Thank you for all your help to solve this puzzle. If you need more information, please let us know.
P.S. I like to be cc'ed on the discussions related to this problem.###############################################
Jie Chen
Scientific Computing Group
Thomas Jefferson National Accelerator Facility
12000, Jefferson Ave.
Newport News, VA 23606(757)269-5046 (office) (757)269-6248 (fax)
[email protected]
###############################################
Quoted 8 lines · Eric Dumazet
Quoted 4 lines · Jie Chen
Hi, there:
We have a simple pthread program that measures the synchronization
overheads for various synchronization mechanisms such as spin locks, barriers (the barrier is implemented using queue-based barrier algorithm) and so on. We have dual quad-core AMD opterons (barcelona) clusters running 2.6.23.8 kernel at this moment using Fedora Core 7 distribution. Before we moved to this kernel, we had kernel 2.6.21. These two kernels are configured identical and compiled with the same gcc 4.1.2 compiler. Under the old kernel, we observed that the performance of these overheads increases as the number of threads increases from 2 to 8. The following are the values of total time and overhead for all threads acquiring a pthread spin lock and all threads executing a barrier synchronization call.Could you post the source of your test program ?
Hi, Eric:
Thank you for the quick response. You can get the source code containing the test code from ftp://ftp.jlab.org/pub/hpc/qmt.tar.gz . This is a data parallel threading package for physics calculation. The test code is pthread_sync in the src directory once you unpack the gz file. To configure and build this package is very simple: configure and make. The
test program is built by make check. The number of threads is
controlled by QMT_NUM_THREADS. The package is using pthread spin lock, but the barrier is implemented using a queue-based barrier algorithm proposed by J. B. Carter of University of Utah (2005).
Quoted 5 lines
spinlock are ... spining and should not call linux scheduler, so I have no idea why a kernel change could modify your results.
Also I suspect you'll have better results with Fedora Core 8 (since glibc was updated to use private futexes in v 2.7), at least for the barrier ops.
I am not sure what the biggest change between kernel 2.6.21 and 2.6.22 (23) is? Is the scheduler the biggest change between these versions? Can the scheduler of kernel somehow effect the performance? I know the scheduler is trying to do load balance and so on. Can the scheduler move threads to different cores according to the load balance algorithm even though the threads are bound to cores using pthread_setaffinity_np call when the number of threads is fewer than the number of cores? I am thinking about this because the performance of our test code is roughly the same for both kernels when the number of threads equals to the number of cores.
Quoted 52 lines
Quoted 52 lines
Kernel 2.6.21
Number of Threads 2 4 6 8 SpinLock (Time micro second) 10.5618 10.58538 10.5915 10.643 (Overhead) 0.073 0.05746 0.102805 0.154563 Barrier (Time micro second) 11.020410 11.678125 11.9889 12.38002 (Overhead) 0.531660 1.1502 1.500112 1.891617Each thread is bound to a particular core using
pthread_setaffinity_np.Kernel 2.6.23.8
Number of Threads 2 4 6 8 SpinLock (Time micro second) 14.849915 17.117603 14.4496 10.5990 (Overhead) 4.345417 6.617207 3.949435 0.110985 Barrier (Time micro second) 19.462255 20.285117 16.19395 12.37662 (Overhead) 8.957755 9.784722 5.699590 1.869518It is clearly that the synchronization overhead increases as the number of threads increases in the kernel 2.6.21. But the synchronization overhead actually decreases as the number of threads increases in the kernel 2.6.23.8 (We observed the same behavior on kernel 2.6.22 as well). This certainly is not a correct behavior. The kernels are configured with
CONFIG_SMP,CONFIG_NUMA,CONFIG_SCHED_MC,CONFIG_PREEMPT_NONE,CONFIG_DISCONTIGMEMset. The complete kernel configuration file is in the attachment of this e-mail.From what we have read, there was a new scheduler (CFS) appeared from
2.6.22. We are not sure whether the above behavior is caused by the new scheduler.Finally, our machine cpu information is listed in the following:
processor : 0
vendor_id: AuthenticAMD
cpu family : 16
model : 2
model name : Quad-Core AMD Opteron(tm) Processor 2347
stepping : 10
cpu MHz : 1909.801
cache size : 512 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 4
fpu : yesfpu_exception: yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxextfxsr_optpdpe1gb rdtscp
lm 3dnowext 3dnowconstant_tscrep_goodpni cx16 popcntlahf_lmcmp_legacysvm
extapiccr8_legacyaltmovcr8 abm sse4a misalignsse 3dnowprefetch osvw
bogomips : 3822.95
TLB size : 1024 4K pages
clflush size : 64cache_alignment: 64
address sizes : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate
Quoted 7 lines
Quoted 7 lines
In addition, we have schedstat and
sched_debugfiles in the /proc directory.Thank you for all your help to solve this puzzle. If you need more information, please let us know.
P.S. I like to be cc'ed on the discussions related to this problem.
Thank you for your help and happy thanksgiving !
Signature · 10 lines
############################################################################# # Jie Chen # Scientific Computing Group # Thomas Jefferson National Accelerator Facility # Newport News, VA 23606 # # [email protected] # (757)269-5046 (office) # (757)269-6248 (fax) #############################################################################
ons, 21 11 2007 kl. 20:52 -0500, skrev Jie Chen:
Quoted 46 lines
Quoted 16 lines · Eric Dumazet
Quoted 14 lines · Jie Chen
Hi, there:
We have a simple pthread program that measures the synchronization
overheads for various synchronization mechanisms such as spin locks, barriers (the barrier is implemented using queue-based barrier algorithm) and so on. We have dual quad-core AMD opterons (barcelona) clusters running 2.6.23.8 kernel at this moment using Fedora Core 7 distribution. Before we moved to this kernel, we had kernel 2.6.21. These two kernels are configured identical and compiled with the same gcc 4.1.2 compiler. Under the old kernel, we observed that the performance of these overheads increases as the number of threads increases from 2 to 8. The following are the values of total time and overhead for all threads acquiring a pthread spin lock and all threads executing a barrier synchronization call.Quoted 2 lines
Could you post the source of your test program ?
Hi, Eric:
Thank you for the quick response. You can get the source code containing the test code from ftp://ftp.jlab.org/pub/hpc/qmt.tar.gz . This is a data parallel threading package for physics calculation. The test code is
pthread_syncin the src directory once you unpack the gz file. To configure and build this package is very simple: configure and make. The
test program is built by make check. The number of threads is
controlled byQMT_NUM_THREADS. The package is using pthread spin lock, but the barrier is implemented using a queue-based barrier algorithm proposed by J. B. Carter of University of Utah (2005).Quoted 8 lines
spinlock are ... spining and should not call linux scheduler, so I have no idea why a kernel change could modify your results.
Also I suspect you'll have better results with Fedora Core 8 (since glibc was updated to use private futexes in v 2.7), at least for the barrier ops.
Quoted 11 lines
I am not sure what the biggest change between kernel 2.6.21 and 2.6.22
(23) is? Is the scheduler the biggest change between these versions? Can the scheduler of kernel somehow effect the performance? I know the scheduler is trying to do load balance and so on. Can the scheduler move threads to different cores according to the load balance algorithm even though the threads are bound to cores usingpthread_setaffinity_npcall when the number of threads is fewer than the number of cores? I am thinking about this because the performance of our test code is roughly the same for both kernels when the number of threads equals to the number of cores.
There is a backport of the CFS scheduler to 2.6.21, see
http://lkml.org/lkml/2007/11/19/127
Quoted 65 lines
Quoted 65 lines
Quoted 65 lines
Kernel 2.6.21
Number of Threads 2 4 6 8 SpinLock (Time micro second) 10.5618 10.58538 10.5915 10.643 (Overhead) 0.073 0.05746 0.102805 0.154563 Barrier (Time micro second) 11.020410 11.678125 11.9889 12.38002 (Overhead) 0.531660 1.1502 1.500112 1.891617Each thread is bound to a particular core using
pthread_setaffinity_np.Kernel 2.6.23.8
Number of Threads 2 4 6 8 SpinLock (Time micro second) 14.849915 17.117603 14.4496 10.5990 (Overhead) 4.345417 6.617207 3.949435 0.110985 Barrier (Time micro second) 19.462255 20.285117 16.19395 12.37662 (Overhead) 8.957755 9.784722 5.699590 1.869518It is clearly that the synchronization overhead increases as the number of threads increases in the kernel 2.6.21. But the synchronization overhead actually decreases as the number of threads increases in the kernel 2.6.23.8 (We observed the same behavior on kernel 2.6.22 as well). This certainly is not a correct behavior. The kernels are configured with
CONFIG_SMP,CONFIG_NUMA,CONFIG_SCHED_MC,CONFIG_PREEMPT_NONE,CONFIG_DISCONTIGMEMset. The complete kernel configuration file is in the attachment of this e-mail.From what we have read, there was a new scheduler (CFS) appeared from
2.6.22. We are not sure whether the above behavior is caused by the new scheduler.Finally, our machine cpu information is listed in the following:
processor : 0
vendor_id: AuthenticAMD
cpu family : 16
model : 2
model name : Quad-Core AMD Opteron(tm) Processor 2347
stepping : 10
cpu MHz : 1909.801
cache size : 512 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 4
fpu : yesfpu_exception: yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov
pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxextfxsr_optpdpe1gb rdtscp
lm 3dnowext 3dnowconstant_tscrep_goodpni cx16 popcntlahf_lmcmp_legacysvm
extapiccr8_legacyaltmovcr8 abm sse4a misalignsse 3dnowprefetch osvw
bogomips : 3822.95
TLB size : 1024 4K pages
clflush size : 64cache_alignment: 64
address sizes : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstateIn addition, we have schedstat and
sched_debugfiles in the /proc directory.
Quoted 9 lines
Quoted 6 lines
Quoted 6 lines
Thank you for all your help to solve this puzzle. If you need more information, please let us know.
P.S. I like to be cc'ed on the discussions related to this problem.Thank you for your help and happy thanksgiving !
Simon Holm Thøgersen
Quoted 5 lines · Simon Holm Thøgersen
ons, 21 11 2007 kl. 20:52 -0500, skrev Jie Chen:
There is a backport of the CFS scheduler to 2.6.21, see
http://lkml.org/lkml/2007/11/19/127
Hi, Simon:
I will try that after the thanksgiving holiday to find out whether the odd behavior will show up using 2.6.21 with back ported CFS.
Quoted 19 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Kernel 2.6.21
Number of Threads 2 4 6 8 SpinLock (Time micro second) 10.5618 10.58538 10.5915 10.643 (Overhead) 0.073 0.05746 0.102805 0.154563 Barrier (Time micro second) 11.020410 11.678125 11.9889 12.38002 (Overhead) 0.531660 1.1502 1.500112 1.891617Each thread is bound to a particular core using
pthread_setaffinity_np.Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Kernel 2.6.23.8
Number of Threads 2 4 6 8 SpinLock (Time micro second) 14.849915 17.117603 14.4496 10.5990 (Overhead) 4.345417 6.617207 3.949435 0.110985 Barrier (Time micro second) 19.462255 20.285117 16.19395 12.37662 (Overhead) 8.957755 9.784722 5.699590 1.869518
Quoted 3 lines
Simon Holm Thøgersen
I just ran a simple test to prove that the problem may be related to load balance of the scheduler. I first started 6 processes using "taskset -c 2 donothing&; taskset -c 3 donothing&; ..., taskset -c 7 donothing". These 6 processes will run on core 2 to 7. Then I started my test program using two threads bound to core 0 and 1. Here is the result:
Two threads on Kernel 2.6.23.8:
SpinLock (Time micro second) 10.558255
(Overhead) 0.068965
Barrier (Time micro second) 10.865520
(Overhead) 0.376230Similarly, I started 4 donothing processes on core 4, 5, 6 and 7, and ran the test program. I have the following result:
Four threads on Kernel 2.6.23.8:
SpinLock (Time micro second) 10.579413
(Overhead) 0.090023
Barrier (Time micro second) 11.363193
(Overhead) 0.873803Finally, here is the result for 6 threads with two donothing processes running on core 6 and 7:
Six threads on Kernel 2.6.23.8:
SpinLock (Time micro second) 10.590030
(Overhead) 0.100940
Barrier (Time micro second) 11.977548
(Overhead) 1.488458Now the above results are very much similar to the results obtained for the kernel 2.6.21. I hope this helps you guys in some ways. Thank you.
Signature · 10 lines
############################################################################# # Jie Chen # Scientific Computing Group # Thomas Jefferson National Accelerator Facility # Newport News, VA 23606 # # [email protected] # (757)269-5046 (office) # (757)269-6248 (fax) #############################################################################
Quoted 57 lines · Jie Chen
Quoted 5 lines · Simon Holm Th??gersen
ons, 21 11 2007 kl. 20:52 -0500, skrev Jie Chen:
There is a backport of the CFS scheduler to 2.6.21, see
http://lkml.org/lkml/2007/11/19/127Hi, Simon:
I will try that after the thanksgiving holiday to find out whether the odd behavior will show up using 2.6.21 with back ported CFS.
Quoted 19 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Kernel 2.6.21
Number of Threads 2 4 6 8 SpinLock (Time micro second) 10.5618 10.58538 10.5915 10.643 (Overhead) 0.073 0.05746 0.102805 0.154563 Barrier (Time micro second) 11.020410 11.678125 11.9889 12.38002 (Overhead) 0.531660 1.1502 1.500112 1.891617Each thread is bound to a particular core using
pthread_setaffinity_np.Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Kernel 2.6.23.8
Number of Threads 2 4 6 8 SpinLock (Time micro second) 14.849915 17.117603 14.4496 10.5990 (Overhead) 4.345417 6.617207 3.949435 0.110985 Barrier (Time micro second) 19.462255 20.285117 16.19395 12.37662 (Overhead) 8.957755 9.784722 5.699590 1.869518Quoted 3 lines
Simon Holm Th??gersen
I just ran a simple test to prove that the problem may be related to load balance of the scheduler. I first started 6 processes using "taskset -c 2 donothing&; taskset -c 3 donothing&; ..., taskset -c 7 donothing". These 6 processes will run on core 2 to 7. Then I started my test program using two threads bound to core 0 and 1. Here is the result:
Two threads on Kernel 2.6.23.8:
SpinLock (Time micro second) 10.558255 (Overhead) 0.068965 Barrier (Time micro second) 10.865520 (Overhead) 0.376230Similarly, I started 4 donothing processes on core 4, 5, 6 and 7, and ran the test program. I have the following result:
Four threads on Kernel 2.6.23.8:
SpinLock (Time micro second) 10.579413 (Overhead) 0.090023 Barrier (Time micro second) 11.363193 (Overhead) 0.873803Finally, here is the result for 6 threads with two donothing processes running on core 6 and 7:
Quoted 8 lines
Six threads on Kernel 2.6.23.8:
SpinLock (Time micro second) 10.590030 (Overhead) 0.100940 Barrier (Time micro second) 11.977548 (Overhead) 1.488458Now the above results are very much similar to the results obtained for the kernel 2.6.21. I hope this helps you guys in some ways. Thank you.
Yes, this really does look like a scheduling regression. I've added Ingo to the cc: list. Next time you should pick a more descriptive subject line - we've got lots of email about possible bugs.
Signature · 1 line
Mathematics is the supreme nostalgia of our time.
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
In reply to Jie ChenQuoted 10 lines · Jie Chen
Quoted 5 lines · Simon Holm Th??gersen
ons, 21 11 2007 kl. 20:52 -0500, skrev Jie Chen:
There is a backport of the CFS scheduler to 2.6.21, see
http://lkml.org/lkml/2007/11/19/127Hi, Simon:
I will try that after the thanksgiving holiday to find out whether the odd behavior will show up using 2.6.21 with back ported CFS.
would be also nice to test this with 2.6.24-rc4.
Ingo
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 7 lines · Ingo Molnar
Quoted 5 lines · Jie Chen
Quoted 4 lines · Simon Holm Th??gersen
ons, 21 11 2007 kl. 20:52 -0500, skrev Jie Chen:
There is a backport of the CFS scheduler to 2.6.21, see
http://lkml.org/lkml/2007/11/19/127
Quoted 7 lines
Quoted 3 lines
Hi, Simon:
I will try that after the thanksgiving holiday to find out whether the odd behavior will show up using 2.6.21 with back ported CFS.
would be also nice to test this with 2.6.24-rc4.
Ingo
Hi, Ingo:
I will test 2.6.24-rc4 this week and let you know the result. Thanks.
Signature · 10 lines
############################################################################# # Jie Chen # Scientific Computing Group # Thomas Jefferson National Accelerator Facility # Newport News, VA 23606 # # [email protected] # (757)269-5046 (office) # (757)269-6248 (fax) #############################################################################
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
In reply to Ingo MolnarQuoted 7 lines · Ingo Molnar
Quoted 5 lines · Jie Chen
Quoted 4 lines · Simon Holm Th??gersen
ons, 21 11 2007 kl. 20:52 -0500, skrev Jie Chen:
There is a backport of the CFS scheduler to 2.6.21, see
http://lkml.org/lkml/2007/11/19/127
Quoted 7 lines
Quoted 3 lines
Hi, Simon:
I will try that after the thanksgiving holiday to find out whether the odd behavior will show up using 2.6.21 with back ported CFS.
would be also nice to test this with 2.6.24-rc4.
Ingo
Hi, Ingo:
I just ran the same test on two 2.6.24-rc4 kernels: one with CONFIG_FAIR_GROUP_SCHED on and the other with CONFIG_FAIR_GROUP_SCHED off. The odd behavior I described in my previous e-mails were still there for both kernels. Let me know If I can be any more help. Thank you.
Signature · 10 lines
############################################### Jie Chen Scientific Computing Group Thomas Jefferson National Accelerator Facility 12000, Jefferson Ave. Newport News, VA 23606 (757)269-5046 (office) (757)269-6248 (fax) [email protected] ###############################################
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 5 lines · Jie Chen
I just ran the same test on two 2.6.24-rc4 kernels: one with
CONFIG_FAIR_GROUP_SCHEDon and the other withCONFIG_FAIR_GROUP_SCHEDoff. The odd behavior I described in my previous e-mails were still there for both kernels. Let me know If I can be any more help. Thank you.
ok, i had a look at your data, and i think this is the result of the scheduler balancing out to idle CPUs more agressively than before. Doing that is almost always a good idea though - but indeed it can result in "bad" numbers if all you do is to measure the ping-pong "performance" between two threads. (with no real work done by any of them).
the moment you saturate the system a bit more, the numbers should improve even with such a ping-pong test.
do you have testcode (or a modification of your testcase sourcecode) that simulates a real-life situation where 2.6.24-rc4 performs not as well as you'd like it to see? (or if qmt.tar.gz already contains that then please point me towards that portion of the test and how i should run it - thanks!)
Ingo
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 11 lines · Ingo Molnar
Quoted 1 line · Jie Chen
I just ran the same test on two 2.6.24-rc4 kernels: one with
CONFIG_FAIR_GROUP_SCHEDon and the other withCONFIG_FAIR_GROUP_SCHEDoff. The odd behavior I described in my previous e-mails were still there for both kernels. Let me know If I can be any more help. Thank you.ok, i had a look at your data, and i think this is the result of the scheduler balancing out to idle CPUs more agressively than before. Doing that is almost always a good idea though - but indeed it can result in "bad" numbers if all you do is to measure the ping-pong "performance" between two threads. (with no real work done by any of them).
the moment you saturate the system a bit more, the numbers should improve even with such a ping-pong test.
do you have testcode (or a modification of your testcase sourcecode) that simulates a real-life situation where 2.6.24-rc4 performs not as well as you'd like it to see? (or if qmt.tar.gz already contains that then please point me towards that portion of the test and how i should run it - thanks!)
Ingo
I cooked a program shorter than Jie one, to try to understand what was going on. Its a pure cpu burner program, with no thread synchronisation (but the pthread_join at the very end)
As each thread is bound to a given cpu, I am not sure the scheduler is allowed to balance to an idle cpu.
Unfortunatly I dont have a 4 way SMP idle machine available to test it.
$ gcc -O2 -o burner burner.c $ ./burner Time to perform the unit of work on one thread is 0.040328 s Time to perform the unit of work on 2 threads is 0.040221 s
I tried it on a 64 way machine (Thanks David :) ) and noticed some strange
results that may be related to the Niagara hardware (time for 64 threads was nearly the double for one thread)
#include <pthread.h>
#include <sched.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/time.h>
#include <stdio.h>
#include <stdlib.h>
int blockthemall=1;
static void inline cpupause()
{
#if defined(i386)
asm volatile("rep;nop":::"memory");
#else
asm volatile("":::"memory");
#endif
}
/*
* Determines number of cpus
* Can be overiden by the NR_CPUS environment variable */
int number_of_cpus()
{
char line[1024], *p;
int cnt = 0;
FILE *F;
p = getenv("NR_CPUS");
if (p)
return atoi(p);
F = fopen("/proc/cpuinfo", "r");
if (F == NULL) {
perror("/proc/cpuinfo");
return 1;
}
while (fgets(line, sizeof(line), F) != NULL) {
if (memcmp(line, "processor", 9) == 0)
cnt++;
}
fclose(F);
return cnt;
}void compute_elapsed(struct timeval *delta, const struct timeval *t0)
{
struct timeval t1;
gettimeofday(&t1, NULL);
delta->tv_sec = t1.tv_sec - t0->tv_sec;
delta->tv_usec = t1.tv_usec - t0->tv_usec;
if (delta->tv_usec < 0) {
delta->tv_usec += 1000000;
delta->tv_sec--;
}
}int nr_loops = 20*1000000;
double incr=0.3456;
void perform_work()
{
int i;
double t = 0.0;
for (i = 0; i < nr_loops; i++) {
t += incr;
}
if (t < 0.0) printf("well... should not happen\n");
}void set_affinity(int cpu)
{
long cpu_mask;
int res;
cpu_mask = 1L << cpu;
res = sched_setaffinity(0, sizeof(cpu_mask), &cpu_mask);
if (res)
perror("sched_setaffinity");
}void *thread_work(void *arg)
{
int cpu = (int)arg;
set_affinity(cpu);
while (blockthemall)
cpupause();
perform_work();
return (void *)0;
}main(int argc, char *argv[])
{
struct timeval t0, delta;
int nr_cpus, i;
pthread_t *tids;
gettimeofday(&t0, NULL);
perform_work();
compute_elapsed(&delta, &t0);
printf("Time to perform the unit of work on one thread is %d.%06d s\n", delta.tv_sec, delta.tv_usec);
nr_cpus = number_of_cpus();
if (nr_cpus <= 1)
return 0;
tids = malloc(nr_cpus * sizeof(pthread_t));
for (i = 1; i < nr_cpus; i++) {
pthread_create(tids + i, NULL, thread_work, (void *)i);
}
set_affinity(0);
gettimeofday(&t0, NULL);
blockthemall=0;
perform_work();
for (i = 1; i < nr_cpus; i++)
pthread_join(tids[i], NULL);
compute_elapsed(&delta, &t0);
printf("Time to perform the unit of work on %d threads is %d.%06d s\n", nr_cpus, delta.tv_sec, delta.tv_usec);}
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 4 lines · Eric Dumazet
$ gcc -O2 -o burner burner.c $ ./burner Time to perform the unit of work on one thread is 0.040328 s Time to perform the unit of work on 2 threads is 0.040221 s
ok, but this actually suggests that scheduling is fine for this, correct?
Ingo
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 12 lines · Ingo Molnar
Quoted 4 lines · Eric Dumazet
$ gcc -O2 -o burner burner.c $ ./burner Time to perform the unit of work on one thread is 0.040328 s Time to perform the unit of work on 2 threads is 0.040221 sok, but this actually suggests that scheduling is fine for this, correct?
Ingo
Yes, But this machine runs an old kernel. I was just giving you how to run it :)
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
In reply to Ingo MolnarQuoted 6 lines · Ingo Molnar
Quoted 1 line · Jie Chen
I just ran the same test on two 2.6.24-rc4 kernels: one with
CONFIG_FAIR_GROUP_SCHEDon and the other withCONFIG_FAIR_GROUP_SCHEDoff. The odd behavior I described in my previous e-mails were still there for both kernels. Let me know If I can be any more help. Thank you.ok, i had a look at your data, and i think this is the result of the scheduler balancing out to idle CPUs more agressively than before. Doing that is almost always a good idea though - but indeed it can result in "bad" numbers if all you do is to measure the ping-pong "performance" between two threads. (with no real work done by any of them).
My test code are not doing much work but measuring overhead of various synchronization mechanisms such as barrier and lock. I am trying to see the scalability of different implementations/algorithms on multi-core machines.
Quoted 2 lines
the moment you saturate the system a bit more, the numbers should improve even with such a ping-pong test.
You are right. If I manually do load balance (bind unrelated processes on the other cores), my test code perform as well as it did in the kernel 2.6.21.
Quoted 1 line
do you have testcode (or a modification of your testcase sourcecode) that simulates a real-life situation where 2.6.24-rc4 performs not as well as you'd like it to see? (or if qmt.tar.gz already contains that then please point me towards that portion of the test and how i should run it - thanks!)
The qmt.tar.gz code contains a simple test program call pthread_sync under the src directory. You can change the number of threads by setting QMT_NUM_THREADS environment variable. You can build the qmt by doing configure --enable-public-release. I do not have Intel quad core machines, I am not sure whether the behavior will show up on Intel platform. Our cluster is dual quad-core opteron which has its own hardware problem :-).
http://hardware.slashdot.org/article.pl?sid=07/12/04/237248&from=rss
Quoted 2 lines
Ingo
Hi, Ingo:
My test code qmt can be found at ftp://ftp.jlab.org/pub/hpc/qmt.tar.gz. There is a minor performance issue in qmt pointed out by Eric, which I have not put into the tar ball yet. If I can be any help, please let me know. Thank you very much.
Signature · 10 lines
############################################### Jie Chen Scientific Computing Group Thomas Jefferson National Accelerator Facility 12000, Jefferson Ave. Newport News, VA 23606 (757)269-5046 (office) (757)269-6248 (fax) [email protected] ###############################################
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 6 lines · Jie Chen
Quoted 2 lines
the moment you saturate the system a bit more, the numbers should improve even with such a ping-pong test.
You are right. If I manually do load balance (bind unrelated processes on the other cores), my test code perform as well as it did in the kernel 2.6.21.
so right now the results dont seem to be too bad to me - the higher overhead comes from two threads running on two different cores and incurring the overhead of cross-core communications. In a true spread-out workloads that synchronize occasionally you'd get the same kind of overhead so in fact this behavior is more informative of the real overhead i guess. In 2.6.21 the two threads would stick on the same core and produce artificially low latency - which would only be true in a real spread-out workload if all tasks ran on the same core. (which is hardly the thing you want on openmp)
In any case, if i misinterpreted your numbers or if you just disagree, or if have a workload/test that shows worse performance that it could/should, let me know.
Ingo
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 7 lines · Ingo Molnar
Quoted 2 lines · Jie Chen
Quoted 1 line
the moment you saturate the system a bit more, the numbers should improve even with such a ping-pong test.
You are right. If I manually do load balance (bind unrelated processes on the other cores), my test code perform as well as it did in the kernel 2.6.21.
so right now the results dont seem to be too bad to me - the higher overhead comes from two threads running on two different cores and incurring the overhead of cross-core communications. In a true spread-out workloads that synchronize occasionally you'd get the same kind of overhead so in fact this behavior is more informative of the real overhead i guess. In 2.6.21 the two threads would stick on the same core and produce artificially low latency - which would only be true in a real spread-out workload if all tasks ran on the same core. (which is hardly the thing you want on openmp)
I use pthread_setaffinity_np call to bind one thread to one core. Unless
the kernel 2.6.21 does not honor the affinity, I do not see the
difference running two threads on two cores between the new kernel and the old kernel. My test code does not do any numerical calculation, but it does spin waiting on shared/non-shared flags. The reason I am using the affinity is to test synchronization overheads among different cores. In either the new and the old kernel, I do see 200% CPU usage when I ran my test code for two threads. Does this mean two threads are running on two cores? Also I verify a thread is indeed bound to a core by using pthread_getaffinity_np.
Quoted 3 lines
In any case, if i misinterpreted your numbers or if you just disagree, or if have a workload/test that shows worse performance that it could/should, let me know.
Ingo
Hi, Ingo:
Since I am using affinity flag to bind each thread to a different core, the synchronization overhead should increases as the number of cores/threads increases. But what we observed in the new kernel is the opposite. The barrier overhead of two threads is 8.93 micro seconds vs 1.86 microseconds for 8 threads (the old kernel is 0.49 vs 1.86). This will confuse most of people who study the synchronization/communication scalability. I know my test code is not real-world computation which usually use up all cores. I hope I have explained myself clearly. Thank you very much.
Signature · 10 lines
############################################### Jie Chen Scientific Computing Group Thomas Jefferson National Accelerator Facility 12000, Jefferson Ave. Newport News, VA 23606 (757)269-5046 (office) (757)269-6248 (fax) [email protected] ###############################################
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 9 lines · Jie Chen
Since I am using affinity flag to bind each thread to a different core, the synchronization overhead should increases as the number of cores/threads increases. But what we observed in the new kernel is the opposite. The barrier overhead of two threads is 8.93 micro seconds vs 1.86 microseconds for 8 threads (the old kernel is 0.49 vs 1.86). This will confuse most of people who study the synchronization/communication scalability. I know my test code is not real-world computation which usually use up all cores. I hope I have explained myself clearly. Thank you very much.
btw., could you try to not use the affinity mask and let the scheduler manage the spreading of tasks? It generally has a better knowledge about how tasks interrelate.
Ingo
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 7 lines · Ingo Molnar
Quoted 1 line · Jie Chen
Since I am using affinity flag to bind each thread to a different core, the synchronization overhead should increases as the number of cores/threads increases. But what we observed in the new kernel is the opposite. The barrier overhead of two threads is 8.93 micro seconds vs 1.86 microseconds for 8 threads (the old kernel is 0.49 vs 1.86). This will confuse most of people who study the synchronization/communication scalability. I know my test code is not real-world computation which usually use up all cores. I hope I have explained myself clearly. Thank you very much.
btw., could you try to not use the affinity mask and let the scheduler manage the spreading of tasks? It generally has a better knowledge about how tasks interrelate.
Ingo
Hi, Ingo:
I just disabled the affinity mask and reran the test. There were no significant changes for two threads (barrier overhead is around 9 microseconds). As for 8 threads, the barrier overhead actually drops a little, which is good. Let me know whether I can be any help. Thank you very much.
Signature · 10 lines
############################################### Jie Chen Scientific Computing Group Thomas Jefferson National Accelerator Facility 12000, Jefferson Ave. Newport News, VA 23606 (757)269-5046 (office) (757)269-6248 (fax) [email protected] ###############################################
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 5 lines · Jie Chen
I just disabled the affinity mask and reran the test. There were no significant changes for two threads (barrier overhead is around 9 microseconds). As for 8 threads, the barrier overhead actually drops a little, which is good. Let me know whether I can be any help. Thank you very much.
sorry to be dense, but could you give me instructions how i could remove the affinity mask and test the "barrier overhead" myself? I have built "pthread_sync" and it outputs numbers for me - which one would be the barrier overhead: Reference_time_1 ?
Ingo
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 7 lines · Ingo Molnar
Quoted 1 line · Jie Chen
I just disabled the affinity mask and reran the test. There were no significant changes for two threads (barrier overhead is around 9 microseconds). As for 8 threads, the barrier overhead actually drops a little, which is good. Let me know whether I can be any help. Thank you very much.
sorry to be dense, but could you give me instructions how i could remove the affinity mask and test the "barrier overhead" myself? I have built "
pthread_sync" and it outputs numbers for me - which one would be the barrier overhead:Reference_time_1?Ingo
Hi, Ingo:
To disable affinity, do configure --enable-public-release --disable-thread_affinity. You should see barrier overhead like the following:
Computing BARRIER time
Sample_size Average Min Max S.D. Outliers
20 19.486162 19.482250 19.491400 0.002740 0
BARRIER time = 19.486162 microseconds +/- 0.005371
BARRIER overhead = 8.996257 microseconds +/- 0.006575
The Reference_time_1 is the elapsed time for single thread doing simple loop without any synchronization. Thank you.
Signature · 10 lines
############################################### Jie Chen Scientific Computing Group Thomas Jefferson National Accelerator Facility 12000, Jefferson Ave. Newport News, VA 23606 (757)269-5046 (office) (757)269-6248 (fax) [email protected] ###############################################
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 9 lines · Jie Chen
Quoted 4 lines
sorry to be dense, but could you give me instructions how i could remove the affinity mask and test the "barrier overhead" myself? I have built "
pthread_sync" and it outputs numbers for me - which one would be the barrier overhead:Reference_time_1?To disable affinity, do configure --enable-public-release --disable-thread_affinity. You should see barrier overhead like the
following: Computing BARRIER time
Quoted 5 lines
Sample_sizeAverage Min Max S.D. Outliers
20 19.486162 19.482250 19.491400 0.002740 0BARRIER time = 19.486162 microseconds +/- 0.005371
BARRIER overhead = 8.996257 microseconds +/- 0.006575
ok, i did that and rebuilt. I also did "make check" and got src/pthread_sync which i can run. The only thing i'm missing, if i run src/pthread_sync, it outputs "PARALLEL time":
PARALLEL time = 22.486103 microseconds +/- 3.944821
PARALLEL overhead = 10.638658 microseconds +/- 10.854154
not "BARRIER time". I've re-read the discussion and found no hint about how to build and run a barrier test. Either i missed it or it's so obvious to you that you didnt mention it :-)
Ingo
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 13 lines · Ingo Molnar
Quoted 10 lines · Jie Chen
Quoted 1 line
sorry to be dense, but could you give me instructions how i could remove the affinity mask and test the "barrier overhead" myself? I have built "
pthread_sync" and it outputs numbers for me - which one would be the barrier overhead:Reference_time_1?To disable affinity, do configure --enable-public-release --disable-thread_affinity. You should see barrier overhead like the
following: Computing BARRIER time
Sample_sizeAverage Min Max S.D. Outliers
20 19.486162 19.482250 19.491400 0.002740 0BARRIER time = 19.486162 microseconds +/- 0.005371
BARRIER overhead = 8.996257 microseconds +/- 0.006575
Quoted 8 lines
ok, i did that and rebuilt. I also did "make check" and got src/pthread_sync which i can run. The only thing i'm missing, if i run src/pthread_sync, it outputs "PARALLEL time":
PARALLEL time = 22.486103 microseconds +/- 3.944821
PARALLEL overhead = 10.638658 microseconds +/- 10.854154not "BARRIER time". I've re-read the discussion and found no hint about how to build and run a barrier test. Either i missed it or it's so obvious to you that you didnt mention it :-)
Ingo
Hi, Ingo:
Did you do configure --enable-public-release? My qmt is for qcd calculation (one type of physics code). Without the above flag one can only test PARALLEL overhead. Actually the PARALLEL benchmark has the same behavior as the BARRIER. Thanks.
###############################################
Jie Chen
Scientific Computing Group
Thomas Jefferson National Accelerator Facility
12000, Jefferson Ave.
Newport News, VA 23606
(757)269-5046 (office) (757)269-6248 (fax)
[email protected]
###############################################
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 10 lines · Jie Chen
Quoted 5 lines
not "BARRIER time". I've re-read the discussion and found no hint about how to build and run a barrier test. Either i missed it or it's so obvious to you that you didnt mention it :-)
Ingo
Hi, Ingo:
Did you do configure --enable-public-release? My qmt is for qcd calculation (one type of physics code) [...]
yes, i did exactly as instructed.
Quoted 3 lines
[...]. Without the above flag one can only test PARALLEL overhead. Actually the PARALLEL benchmark has the same behavior as the BARRIER. Thanks.
hm, but PARALLEL does not seem to do that much context switching. So basically you create the threads and do a few short runs to establish overhead? Threads do not get fork-balanced at the moment - but turning it on would be easy. Could you try the patch below - how does it impact your results? (and please keep affinity setting off)
Ingo
----------->
Subject: sched: reactivate fork balancing
From: Ingo Molnar <[email protected]>
reactivate fork balancing.
--- include/linux/topology.h | 3 +++ 1 file changed, 3 insertions(+)
include/linux/topology.h +3 -0
@@ -103,6 +103,7 @@ .forkexec_idx = 0, \ .flags =SD_LOAD_BALANCE \ |SD_BALANCE_NEWIDLE \ + |SD_BALANCE_FORK \ |SD_BALANCE_EXEC \ |SD_WAKE_AFFINE \ |SD_WAKE_IDLE \
@@ -134,6 +135,7 @@ .forkexec_idx = 1, \ .flags =SD_LOAD_BALANCE \ |SD_BALANCE_NEWIDLE \ + |SD_BALANCE_FORK \ |SD_BALANCE_EXEC \ |SD_WAKE_AFFINE \ |SD_WAKE_IDLE \
@@ -165,6 +167,7 @@ .forkexec_idx = 1, \ .flags =SD_LOAD_BALANCE \ |SD_BALANCE_NEWIDLE \ + |SD_BALANCE_FORK \ |SD_BALANCE_EXEC \ |SD_WAKE_AFFINE \ | BALANCE_FOR_PKG_POWER,\
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 49 lines · Ingo Molnar
Quoted 6 lines · Jie Chen
Quoted 3 lines
not "BARRIER time". I've re-read the discussion and found no hint about how to build and run a barrier test. Either i missed it or it's so obvious to you that you didnt mention it :-)
Ingo
Hi, Ingo:
Did you do configure --enable-public-release? My qmt is for qcd calculation (one type of physics code) [...]
yes, i did exactly as instructed.
Quoted 1 line
[...]. Without the above flag one can only test PARALLEL overhead. Actually the PARALLEL benchmark has the same behavior as the BARRIER. Thanks.
hm, but PARALLEL does not seem to do that much context switching. So basically you create the threads and do a few short runs to establish overhead? Threads do not get fork-balanced at the moment - but turning it on would be easy. Could you try the patch below - how does it impact your results? (and please keep affinity setting off)
Ingo
----------->
Subject: sched: reactivate fork balancing
From: Ingo Molnar <[email protected]>reactivate fork balancing.
Signed-off-by Ingo Molnar <[email protected]>--- include/linux/topology.h | 3 +++ 1 file changed, 3 insertions(+)Index:
linux/include/linux/topology.h
===================================================================include/linux/topology.h +2
-0@@ -103,6 +103,7 @@ .forkexec_idx = 0, \ .flags =SD_LOAD_BALANCE \ |SD_BALANCE_NEWIDLE \ + |SD_BALANCE_FORK \ |SD_BALANCE_EXEC \ |SD_WAKE_AFFINE \ |SD_WAKE_IDLE \@@ -134,6 +135,7 @@ .forkexec_idx = 1, \ .flags =SD_LOAD_BALANCE \ |SD_BALANCE_NEWIDLE \ + |SD_BALANCE_FORK \ |SD_BALANCE_EXEC \ |SD_WAKE_AFFINE \ |SD_WAKE_IDLE \
include/linux/topology.h line 173
Quoted 7 lines
include/linux/topology.h +1
-0@@ -165,6 +167,7 @@ .forkexec_idx = 1, \ .flags =SD_LOAD_BALANCE \ |SD_BALANCE_NEWIDLE \ + |SD_BALANCE_FORK \ |SD_BALANCE_EXEC \ |SD_WAKE_AFFINE \ | BALANCE_FOR_PKG_POWER,\
Hi, Ingo:
I did patch the header file and recompiled the kernel. I observed no difference (two threads overhead stays too high). Thank you.
Signature · 10 lines
############################################### Jie Chen Scientific Computing Group Thomas Jefferson National Accelerator Facility 12000, Jefferson Ave. Newport News, VA 23606 (757)269-5046 (office) (757)269-6248 (fax) [email protected] ###############################################
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 2 lines · Jie Chen
I did patch the header file and recompiled the kernel. I observed no difference (two threads overhead stays too high). Thank you.
ok, i think i found it. You do this in your qmt/pthread_sync.c test-code:
double get_time_of_day_()
{
...
err = gettimeofday(&ts, NULL);
...
}
and then you use this in the measurement loop:
for (k=0; k<=OUTERREPS; k++){
start = getclock();
for (j=0; j<innerreps; j++){
#ifdef _QMT_PUBLIC
delay((void *)0, 0);
#else
delay(0, 0, 0, (void *)0);
#endif
}
times[k] = (getclock() - start) * 1.0e6 / (double) innerreps;}
the problem is, this does not take the overhead of gettimeofday into account - which overhead can easily reach 10 usecs (the observed regression). Could you try to eliminate the gettimeofday overhead from your measurement?
gettimeofday overhead is something that might have changed from .21 to .22 on your box.
Ingo
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 25 lines · Ingo Molnar
Quoted 1 line · Jie Chen
I did patch the header file and recompiled the kernel. I observed no difference (two threads overhead stays too high). Thank you.
ok, i think i found it. You do this in your
qmt/pthread_sync.ctest-code:double
get_time_of_day_()
{
...
err =gettimeofday(&ts, NULL);
...
}and then you use this in the measurement loop:
for (k=0; k<=OUTERREPS; k++){ start = getclock(); for (j=0; j<innerreps; j++){ #ifdef _QMT_PUBLIC delay((void *)0, 0); #else delay(0, 0, 0, (void *)0); #endif } times[k] = (getclock() - start) * 1.0e6 / (double) innerreps;
Quoted 7 lines
}
the problem is, this does not take the overhead of gettimeofday into account - which overhead can easily reach 10 usecs (the observed regression). Could you try to eliminate the gettimeofday overhead from your measurement?
gettimeofday overhead is something that might have changed from .21 to .22 on your box.
Ingo
Hi, Ingo:
In my pthread_sync code, I first call refer () subroutine which actually establishes the elapsed time (reference time) for non-synchronized delay() using the gettimeofday. Then each synchronization overhead value is obtained by subtracting the reference time from the elapsed time with introduced synchronization. The effect of gettimeofday() should be minimal if the time difference (overhead value) is the interest here. Unless the gettimeofday behaves differently in the case of running 8 threads .vs. running 2 threads.
I will try to replace gettimeofday with a lightweight timer call in my test code. Thank you very much.
Signature · 10 lines
############################################### Jie Chen Scientific Computing Group Thomas Jefferson National Accelerator Facility 12000, Jefferson Ave. Newport News, VA 23606 (757)269-5046 (office) (757)269-6248 (fax) [email protected] ###############################################
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 35 lines · Jie Chen
Quoted 19 lines
and then you use this in the measurement loop:
for (k=0; k<=OUTERREPS; k++){ start = getclock(); for (j=0; j<innerreps; j++){ #ifdef _QMT_PUBLIC delay((void *)0, 0); #else delay(0, 0, 0, (void *)0); #endif } times[k] = (getclock() - start) * 1.0e6 / (double) innerreps;}
the problem is, this does not take the overhead of gettimeofday into account - which overhead can easily reach 10 usecs (the observed regression). Could you try to eliminate the gettimeofday overhead from your measurement?
Quoted 4 lines
gettimeofday overhead is something that might have changed from .21 to .22 on your box.
Ingo
Hi, Ingo:
In my
pthread_synccode, I first call refer () subroutine which actually establishes the elapsed time (reference time) for non-synchronizeddelay()using the gettimeofday. Then each synchronization overhead value is obtained by subtracting the reference time from the elapsed time with introduced synchronization. The effect ofgettimeofday()should be minimal if the time difference (overhead value) is the interest here. Unless the gettimeofday behaves differently in the case of running 8 threads .vs. running 2 threads.
Quoted 2 lines
I will try to replace gettimeofday with a lightweight timer call in my test code. Thank you very much.
gettimeofday overhead is around 10 usecs here:
2740 1197359374.873214 gettimeofday({1197359374, 873225}, NULL) = 0 <0.000010> 2740 1197359374.970592 gettimeofday({1197359374, 970608}, NULL) = 0 <0.000010>
and that's the only thing that is going on when computing the reference time - and i see a similar syscall pattern in the PARALLEL and BARRIER calculations as well (with no real scheduling going on).
Ingo
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 27 lines · Ingo Molnar
Quoted 16 lines · Jie Chen
Quoted 16 lines
and then you use this in the measurement loop:
for (k=0; k<=OUTERREPS; k++){ start = getclock(); for (j=0; j<innerreps; j++){ #ifdef _QMT_PUBLIC delay((void *)0, 0); #else delay(0, 0, 0, (void *)0); #endif } times[k] = (getclock() - start) * 1.0e6 / (double) innerreps;}
the problem is, this does not take the overhead of gettimeofday into account - which overhead can easily reach 10 usecs (the observed regression). Could you try to eliminate the gettimeofday overhead from your measurement?
Quoted 8 lines
Quoted 3 lines
gettimeofday overhead is something that might have changed from .21 to .22 on your box.
Ingo
Hi, Ingo:
In my
pthread_synccode, I first call refer () subroutine which actually establishes the elapsed time (reference time) for non-synchronizeddelay()using the gettimeofday. Then each synchronization overhead value is obtained by subtracting the reference time from the elapsed time with introduced synchronization. The effect ofgettimeofday()should be minimal if the time difference (overhead value) is the interest here. Unless the gettimeofday behaves differently in the case of running 8 threads .vs. running 2 threads.I will try to replace gettimeofday with a lightweight timer call in my test code. Thank you very much.
Quoted 8 lines
gettimeofday overhead is around 10 usecs here:
2740 1197359374.873214
gettimeofday({1197359374, 873225}, NULL)= 0 <0.000010> 2740 1197359374.970592gettimeofday({1197359374, 970608}, NULL)= 0 <0.000010>and that's the only thing that is going on when computing the reference time - and i see a similar syscall pattern in the PARALLEL and BARRIER calculations as well (with no real scheduling going on).
Ingo
Hi, Ingo:
I guess it is a good news. I did patch 2.6.21.7 kernel using your cfs patch. The results of pthread_sync is the same as the non-patched 2.6.21 kernel. This means the performance of is not related to the scheduler. As for overhead of the gettimeofday, there is no difference between 2.6.21 and 2.6.24-rc4. The reference time is around 10.5 us for both kernel.
So what is changed between 2.6.21 and 2.6.22? Any hints :-). Thank you very much for all your help.
Signature · 10 lines
############################################### Jie Chen Scientific Computing Group Thomas Jefferson National Accelerator Facility 12000, Jefferson Ave. Newport News, VA 23606 (757)269-5046 (office) (757)269-6248 (fax) [email protected] ###############################################
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 8 lines · Jie Chen
Hi, Ingo:
I guess it is a good news. I did patch 2.6.21.7 kernel using your cfs patch. The results of
pthread_syncis the same as the non-patched 2.6.21 kernel. This means the performance of is not related to the scheduler. As for overhead of the gettimeofday, there is no difference between 2.6.21 and 2.6.24-rc4. The reference time is around 10.5 us for both kernel.
could you please paste again the relevant portion of the output you get on a "good" .21 kernel versus the output you get on a "bad" .24 kernel?
Quoted 2 lines
So what is changed between 2.6.21 and 2.6.22? Any hints :-). Thank you very much for all your help.
we'll figure it out i'm sure :)
Ingo
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 6 lines · Ingo Molnar
Quoted 3 lines · Jie Chen
Hi, Ingo:
I guess it is a good news. I did patch 2.6.21.7 kernel using your cfs patch. The results of
pthread_syncis the same as the non-patched 2.6.21 kernel. This means the performance of is not related to the scheduler. As for overhead of the gettimeofday, there is no difference between 2.6.21 and 2.6.24-rc4. The reference time is around 10.5 us for both kernel.
Quoted 7 lines
could you please paste again the relevant portion of the output you get on a "good" .21 kernel versus the output you get on a "bad" .24 kernel?
Quoted 1 line
So what is changed between 2.6.21 and 2.6.22? Any hints :-). Thank you very much for all your help.
we'll figure it out i'm sure :)
Ingo
Hi, Ingo:
The following is pthread_sync output for 2.6.21.7-cfs-v24 #1 SMP kernel.
2 threads:
Computing reference time 1
Sample_size Average Min Max S.D. Outliers
20 10.489085 10.488800 10.491100 0.000539 1
Reference_time_1 = 10.489085 microseconds +/- 0.001057
Computing PARALLEL time
Sample_size Average Min Max S.D. Outliers
20 11.106580 11.105650 11.109700 0.001255 0
PARALLEL time = 11.106580 microseconds +/- 0.002460
PARALLEL overhead = 0.617590 microseconds +/- 0.003409
8 threads:
Computing reference time 1
Sample_size Average Min Max S.D. Outliers
20 10.488735 10.488500 10.490700 0.000484 1
Reference_time_1 = 10.488735 microseconds +/- 0.000948
Computing PARALLEL time
Sample_size Average Min Max S.D. Outliers
20 13.000647 12.991050 13.052700 0.012592 1
PARALLEL time = 13.000647 microseconds +/- 0.024680
PARALLEL overhead = 2.511907 microseconds +/- 0.025594
Output for Kernel 2.6.24-rc4 #1 SMP
2 threads:
Computing reference time 1
Sample_size Average Min Max S.D. Outliers
20 10.510535 10.508600 10.518200 0.002237 1
Reference_time_1 = 10.510535 microseconds +/- 0.004384
Computing PARALLEL time
Sample_size Average Min Max S.D. Outliers
20 19.668450 19.650200 19.679650 0.008052 0
PARALLEL time = 19.668450 microseconds +/- 0.015782
PARALLEL overhead = 9.157945 microseconds +/- 0.018217
8 threads:
Computing reference time 1
Sample_size Average Min Max S.D. Outliers
20 10.491285 10.490100 10.494900 0.001085 1
Reference_time_1 = 10.491285 microseconds +/- 0.002127
Computing PARALLEL time
Sample_size Average Min Max S.D. Outliers
20 13.090080 13.079150 13.131450 0.010995 1
PARALLEL time = 13.090080 microseconds +/- 0.021550
PARALLEL overhead = 2.598590 microseconds +/- 0.024534
For 8 threads, both kernels have the similar performance number. But for 2 threads, the 2.6.21 is much better than 2.6.24-rc4. Thank you.
Signature · 10 lines
############################################### Jie Chen Scientific Computing Group Thomas Jefferson National Accelerator Facility 12000, Jefferson Ave. Newport News, VA 23606 (757)269-5046 (office) (757)269-6248 (fax) [email protected] ###############################################
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 5 lines · Jie Chen
The following is
pthread_syncoutput for 2.6.21.7-cfs-v24 #1 SMP kernel.2 threads:
Quoted 7 lines
PARALLEL time = 11.106580 microseconds +/- 0.002460
PARALLEL overhead = 0.617590 microseconds +/- 0.003409Output for Kernel 2.6.24-rc4 #1 SMP
PARALLEL time = 19.668450 microseconds +/- 0.015782
PARALLEL overhead = 9.157945 microseconds +/- 0.018217
ok, so the problem is that this PARALLEL time has an additional +9 usecs overhead, right? I dont see this myself on a Core2 CPU:
PARALLEL time = 10.446933 microseconds +/- 0.078849
PARALLEL overhead = 0.751732 microseconds +/- 0.177446
Ingo
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 14 lines · Ingo Molnar
Quoted 11 lines · Jie Chen
The following is
pthread_syncoutput for 2.6.21.7-cfs-v24 #1 SMP kernel.2 threads:
PARALLEL time = 11.106580 microseconds +/- 0.002460
PARALLEL overhead = 0.617590 microseconds +/- 0.003409Output for Kernel 2.6.24-rc4 #1 SMP
PARALLEL time = 19.668450 microseconds +/- 0.015782
PARALLEL overhead = 9.157945 microseconds +/- 0.018217
Quoted 6 lines
ok, so the problem is that this PARALLEL time has an additional +9 usecs overhead, right? I dont see this myself on a Core2 CPU:
PARALLEL time = 10.446933 microseconds +/- 0.078849
PARALLEL overhead = 0.751732 microseconds +/- 0.177446Ingo
Hi, Ingo:
Yes, the extra 9 usecs overhead for running two threads in the 2.6.24 kernel when there are total of 8 cores (2 quad opterons). What is the total number of cores do you have? I do not have machines that have dual quad Xeons here for direct comparisons. Thank you.
Signature · 10 lines
############################################################################# # Jie Chen # Scientific Computing Group # Thomas Jefferson National Accelerator Facility # Newport News, VA 23606 # # [email protected] # (757)269-5046 (office) # (757)269-6248 (fax) #############################################################################
Re: Possible bug from kernel 2.6.22 and above, 2.6.24-rc4
Quoted 16 lines · Jie Chen
Quoted 15 lines · Ingo Molnar
Quoted 12 lines · Jie Chen
The following is
pthread_syncoutput for 2.6.21.7-cfs-v24 #1 SMP kernel.2 threads:
PARALLEL time = 11.106580 microseconds +/- 0.002460
PARALLEL overhead = 0.617590 microseconds +/- 0.003409Output for Kernel 2.6.24-rc4 #1 SMP
PARALLEL time = 19.668450 microseconds +/- 0.015782
PARALLEL overhead = 9.157945 microseconds +/- 0.018217
Quoted 6 lines
Quoted 6 lines
ok, so the problem is that this PARALLEL time has an additional +9 usecs overhead, right? I dont see this myself on a Core2 CPU:
PARALLEL time = 10.446933 microseconds +/- 0.078849
PARALLEL overhead = 0.751732 microseconds +/- 0.177446
On my dual socket AMD Athlon MP
2.6.20-13-generic
PARALLEL time = 22.751875 microseconds +/- 21.370942
PARALLEL overhead = 7.046595 microseconds +/- 24.370040
2.6.24-rc5
PARALLEL time = 17.365543 microseconds +/- 3.295133
PARALLEL overhead = 2.213722 microseconds +/- 4.797886
Quoted 9 lines · Jie Chen
It is clearly that the synchronization overhead increases as the number of threads increases in the kernel 2.6.21. But the synchronization overhead actually decreases as the number of threads increases in the kernel 2.6.23.8 (We observed the same behavior on kernel 2.6.22 as well). This certainly is not a correct behavior. The kernels are configured with
CONFIG_SMP,CONFIG_NUMA,CONFIG_SCHED_MC,CONFIG_PREEMPT_NONE,CONFIG_DISCONTIGMEMset. The complete kernel configuration file is in the attachment of this e-mail.
Quoted 3 lines
From what we have read, there was a new scheduler (CFS) appeared from
2.6.22. We are not sure whether the above behavior is caused by the new scheduler.
If I read this correctly, you say that: .22 is the first bad one right?
The new scheduler (CFS) was introduced in .23, so it seems another change would be responsible for this.
Quoted 4 lines · Peter Zijlstra
Quoted 2 lines · Jie Chen
It is clearly that the synchronization overhead increases as the number of threads increases in the kernel 2.6.21. But the synchronization overhead actually decreases as the number of threads increases in the kernel 2.6.23.8 (We observed the same behavior on kernel 2.6.22 as well). This certainly is not a correct behavior. The kernels are configured with
CONFIG_SMP,CONFIG_NUMA,CONFIG_SCHED_MC,CONFIG_PREEMPT_NONE,CONFIG_DISCONTIGMEMset. The complete kernel configuration file is in the attachment of this e-mail.
Quoted 10 lines
Quoted 2 lines
From what we have read, there was a new scheduler (CFS) appeared from
2.6.22. We are not sure whether the above behavior is caused by the new scheduler.If I read this correctly, you say that: .22 is the first bad one right?
The new scheduler (CFS) was introduced in .23, so it seems another change would be responsible for this.
Hi, Peter:
Yes. We did observe this in 2.6.22. Thank you.
Signature · 10 lines
############################################### Jie Chen Scientific Computing Group Thomas Jefferson National Accelerator Facility 12000, Jefferson Ave. Newport News, VA 23606 (757)269-5046 (office) (757)269-6248 (fax) [email protected] ###############################################