Summary: --- /tmp/before 2007-01-30 13:09:01.000000000 -0200 +++ /tmp/after 2007-01-30 13:08:55.000000000 -0200 @@ -1,3 +1,5 @@ +/* moving swdma_mask(size=1) to after name(offset=16, size=6, hole=2) */ + /* /home/acme/git/linux-2.6/include/linux/ide.h:188 */ struct hwif_s { struct hwif_s * next; @@ -5,8 +7,9 @@ struct hwgroup_s * hwgroup; struct proc_dir_entry *proc; char name[6]; + u8 swdma_mask; - /* XXX 2 bytes hole, try to pack */ + /* XXX 1 byte hole, try to pack */ long unsigned int io_ports[10]; /* --- cacheline 1 boundary (64 bytes) --- */ @@ -25,10 +28,6 @@ u8 atapi_dma; u8 ultra_mask; u8 mwdma_mask; - u8 swdma_mask; - - /* XXX 3 bytes hole, try to pack */ - hwif_chipset_t chipset; struct pci_dev * pci_dev; struct ide_pci_device_s *cds; @@ -43,8 +42,8 @@ void (*maskproc)(ide_drive_t *, int); int (*quirkproc)(ide_drive_t *); int (*busproc)(ide_drive_t *, int); - /* --- cacheline 22 boundary (1408 bytes) --- */ void (*ata_input_data)(ide_drive_t *, void *, u32); + /* --- cacheline 22 boundary (1408 bytes) --- */ void (*ata_output_data)(ide_drive_t *, void *, u32); void (*atapi_input_bytes)(ide_drive_t *, void *, u32); void (*atapi_output_bytes)(ide_drive_t *, void *, u32); @@ -60,8 +59,8 @@ int (*ide_dma_host_off)(ide_drive_t *); int (*ide_dma_lostirq)(ide_drive_t *); int (*ide_dma_timeout)(ide_drive_t *); - /* --- cacheline 23 boundary (1472 bytes) --- */ void (*OUTB)(u8, long unsigned int); + /* --- cacheline 23 boundary (1472 bytes) --- */ void (*OUTBSYNC)(ide_drive_t *, u8, long unsigned int); void (*OUTW)(u16, long unsigned int); void (*OUTL)(u32, long unsigned int); @@ -77,8 +76,8 @@ struct scatterlist * sg_table; int sg_max_nents; int sg_nents; - /* --- cacheline 24 boundary (1536 bytes) --- */ int sg_dma_direction; + /* --- cacheline 24 boundary (1536 bytes) --- */ int data_phase; unsigned int nsect; unsigned int nleft; @@ -94,8 +93,8 @@ long unsigned int dma_status; long unsigned int dma_vendor3; long unsigned int dma_prdtable; - /* --- cacheline 25 boundary (1600 bytes) --- */ long unsigned int config_data; + /* --- cacheline 25 boundary (1600 bytes) --- */ long unsigned int select_data; long unsigned int extra_base; unsigned int extra_ports; @@ -119,12 +118,12 @@ /* XXX 16 bits hole, try to pack */ struct device gendev; - /* --- cacheline 31 boundary (1984 bytes) was 32 bytes ago --- */ + /* --- cacheline 31 boundary (1984 bytes) was 28 bytes ago --- */ struct completion gendev_rel_comp; void * hwif_data; - /* --- cacheline 32 boundary (2048 bytes) --- */ unsigned int dma; -}; /* size: 2052, cachelines: 33 */ - /* sum members: 2047, holes: 2, sum holes: 5 */ + /* --- cacheline 32 boundary (2048 bytes) --- */ +}; /* size: 2048, cachelines: 32 */ + /* sum members: 2047, holes: 2, sum holes: 1 */ /* bit holes: 1, sum bit holes: 16 bits */ - /* last cacheline: 4 bytes */ + /* saved 4 bytes and 1 cacheline! */ ----------------------------------------------------------------------------------- Before: [acme@filo examples]$ pahole OUTPUT/qemu/linux-2.6/drivers/ide/ide-core.o hwif_s /* /home/acme/git/linux-2.6/include/linux/ide.h:188 */ struct hwif_s { struct hwif_s * next; /* 0 4 */ struct hwif_s * mate; /* 4 4 */ struct hwgroup_s * hwgroup; /* 8 4 */ struct proc_dir_entry * proc; /* 12 4 */ char name[6]; /* 16 6 */ /* XXX 2 bytes hole, try to pack */ long unsigned int io_ports[10]; /* 24 40 */ /* --- cacheline 1 boundary (64 bytes) --- */ long unsigned int sata_scr[3]; /* 64 12 */ long unsigned int sata_misc[3]; /* 76 12 */ hw_regs_t hw; /* 88 60 */ /* --- cacheline 2 boundary (128 bytes) was 20 bytes ago --- */ ide_drive_t drives[2]; /* 148 1192 */ /* --- cacheline 20 boundary (1280 bytes) was 60 bytes ago --- */ u8 major; /* 1340 1 */ u8 index; /* 1341 1 */ u8 channel; /* 1342 1 */ u8 straight8; /* 1343 1 */ /* --- cacheline 21 boundary (1344 bytes) --- */ u8 bus_state; /* 1344 1 */ u8 atapi_dma; /* 1345 1 */ u8 ultra_mask; /* 1346 1 */ u8 mwdma_mask; /* 1347 1 */ u8 swdma_mask; /* 1348 1 */ /* XXX 3 bytes hole, try to pack */ hwif_chipset_t chipset; /* 1352 4 */ struct pci_dev * pci_dev; /* 1356 4 */ struct ide_pci_device_s *cds; /* 1360 4 */ void (*rw_disk)(ide_drive_t *, struct request *); /* 1364 4 */ void (*tuneproc)(ide_drive_t *, u8); /* 1368 4 */ int (*speedproc)(ide_drive_t *, u8); /* 1372 4 */ void (*selectproc)(ide_drive_t *); /* 1376 4 */ int (*reset_poll)(ide_drive_t *); /* 1380 4 */ void (*pre_reset)(ide_drive_t *); /* 1384 4 */ void (*resetproc)(ide_drive_t *); /* 1388 4 */ void (*intrproc)(ide_drive_t *); /* 1392 4 */ void (*maskproc)(ide_drive_t *, int); /* 1396 4 */ int (*quirkproc)(ide_drive_t *); /* 1400 4 */ int (*busproc)(ide_drive_t *, int); /* 1404 4 */ /* --- cacheline 22 boundary (1408 bytes) --- */ void (*ata_input_data)(ide_drive_t *, void *, u32); /* 1408 4 */ void (*ata_output_data)(ide_drive_t *, void *, u32); /* 1412 4 */ void (*atapi_input_bytes)(ide_drive_t *, void *, u32); /* 1416 4 */ void (*atapi_output_bytes)(ide_drive_t *, void *, u32); /* 1420 4 */ int (*dma_setup)(ide_drive_t *); /* 1424 4 */ void (*dma_exec_cmd)(ide_drive_t *, u8); /* 1428 4 */ void (*dma_start)(ide_drive_t *); /* 1432 4 */ int (*ide_dma_end)(ide_drive_t *); /* 1436 4 */ int (*ide_dma_check)(ide_drive_t *); /* 1440 4 */ int (*ide_dma_on)(ide_drive_t *); /* 1444 4 */ int (*ide_dma_off_quietly)(ide_drive_t *); /* 1448 4 */ int (*ide_dma_test_irq)(ide_drive_t *); /* 1452 4 */ int (*ide_dma_host_on)(ide_drive_t *); /* 1456 4 */ int (*ide_dma_host_off)(ide_drive_t *); /* 1460 4 */ int (*ide_dma_lostirq)(ide_drive_t *); /* 1464 4 */ int (*ide_dma_timeout)(ide_drive_t *); /* 1468 4 */ /* --- cacheline 23 boundary (1472 bytes) --- */ void (*OUTB)(u8, long unsigned int); /* 1472 4 */ void (*OUTBSYNC)(ide_drive_t *, u8, long unsigned int); /* 1476 4 */ void (*OUTW)(u16, long unsigned int); /* 1480 4 */ void (*OUTL)(u32, long unsigned int); /* 1484 4 */ void (*OUTSW)(long unsigned int, void *, u32); /* 1488 4 */ void (*OUTSL)(long unsigned int, void *, u32); /* 1492 4 */ u8 (*INB)(long unsigned int); /* 1496 4 */ u16 (*INW)(long unsigned int); /* 1500 4 */ u32 (*INL)(long unsigned int); /* 1504 4 */ void (*INSW)(long unsigned int, void *, u32); /* 1508 4 */ void (*INSL)(long unsigned int, void *, u32); /* 1512 4 */ unsigned int * dmatable_cpu; /* 1516 4 */ dma_addr_t dmatable_dma; /* 1520 4 */ struct scatterlist * sg_table; /* 1524 4 */ int sg_max_nents; /* 1528 4 */ int sg_nents; /* 1532 4 */ /* --- cacheline 24 boundary (1536 bytes) --- */ int sg_dma_direction; /* 1536 4 */ int data_phase; /* 1540 4 */ unsigned int nsect; /* 1544 4 */ unsigned int nleft; /* 1548 4 */ unsigned int cursg; /* 1552 4 */ unsigned int cursg_ofs; /* 1556 4 */ int mmio; /* 1560 4 */ int rqsize; /* 1564 4 */ int irq; /* 1568 4 */ long unsigned int dma_master; /* 1572 4 */ long unsigned int dma_base; /* 1576 4 */ long unsigned int dma_command; /* 1580 4 */ long unsigned int dma_vendor1; /* 1584 4 */ long unsigned int dma_status; /* 1588 4 */ long unsigned int dma_vendor3; /* 1592 4 */ long unsigned int dma_prdtable; /* 1596 4 */ /* --- cacheline 25 boundary (1600 bytes) --- */ long unsigned int config_data; /* 1600 4 */ long unsigned int select_data; /* 1604 4 */ long unsigned int extra_base; /* 1608 4 */ unsigned int extra_ports; /* 1612 4 */ unsigned int noprobe:1; /* 1616 4 */ unsigned int present:1; /* 1616 4 */ unsigned int hold:1; /* 1616 4 */ unsigned int serialized:1; /* 1616 4 */ unsigned int sharing_irq:1; /* 1616 4 */ unsigned int reset:1; /* 1616 4 */ unsigned int autodma:1; /* 1616 4 */ unsigned int udma_four:1; /* 1616 4 */ unsigned int no_lba48:1; /* 1616 4 */ unsigned int no_lba48_dma:1; /* 1616 4 */ unsigned int no_dsc:1; /* 1616 4 */ unsigned int auto_poll:1; /* 1616 4 */ unsigned int sg_mapped:1; /* 1616 4 */ unsigned int no_io_32bit:1; /* 1616 4 */ unsigned int err_stops_fifo:1; /* 1616 4 */ unsigned int atapi_irq_bogon:1; /* 1616 4 */ /* XXX 16 bits hole, try to pack */ struct device gendev; /* 1620 396 */ /* --- cacheline 31 boundary (1984 bytes) was 32 bytes ago --- */ struct completion gendev_rel_comp; /* 2016 28 */ void * hwif_data; /* 2044 4 */ /* --- cacheline 32 boundary (2048 bytes) --- */ unsigned int dma; /* 2048 4 */ }; /* size: 2052, cachelines: 33 */ /* sum members: 2047, holes: 2, sum holes: 5 */ /* bit holes: 1, sum bit holes: 16 bits */ /* last cacheline: 4 bytes */ ----------------------------------------------------------------------------------- After: [acme@filo examples]$ pahole -kV OUTPUT/qemu/linux-2.6/drivers/ide/ide-core.o hwif_s /* moving swdma_mask(size=1) to after name(offset=16, size=6, hole=2) */ /* /home/acme/git/linux-2.6/include/linux/ide.h:188 */ struct hwif_s { struct hwif_s * next; /* 0 4 */ struct hwif_s * mate; /* 4 4 */ struct hwgroup_s * hwgroup; /* 8 4 */ struct proc_dir_entry *proc; /* 12 4 */ char name[6]; /* 16 6 */ u8 swdma_mask; /* 22 1 */ /* XXX 1 byte hole, try to pack */ long unsigned int io_ports[10]; /* 24 40 */ /* --- cacheline 1 boundary (64 bytes) --- */ long unsigned int sata_scr[3]; /* 64 12 */ long unsigned int sata_misc[3]; /* 76 12 */ hw_regs_t hw; /* 88 60 */ /* --- cacheline 2 boundary (128 bytes) was 20 bytes ago --- */ ide_drive_t drives[2]; /* 148 1192 */ /* --- cacheline 20 boundary (1280 bytes) was 60 bytes ago --- */ u8 major; /* 1340 1 */ u8 index; /* 1341 1 */ u8 channel; /* 1342 1 */ u8 straight8; /* 1343 1 */ /* --- cacheline 21 boundary (1344 bytes) --- */ u8 bus_state; /* 1344 1 */ u8 atapi_dma; /* 1345 1 */ u8 ultra_mask; /* 1346 1 */ u8 mwdma_mask; /* 1347 1 */ hwif_chipset_t chipset; /* 1348 4 */ struct pci_dev * pci_dev; /* 1352 4 */ struct ide_pci_device_s *cds; /* 1356 4 */ void (*rw_disk)(ide_drive_t *, struct request *); /* 1360 4 */ void (*tuneproc)(ide_drive_t *, u8); /* 1364 4 */ int (*speedproc)(ide_drive_t *, u8); /* 1368 4 */ void (*selectproc)(ide_drive_t *); /* 1372 4 */ int (*reset_poll)(ide_drive_t *); /* 1376 4 */ void (*pre_reset)(ide_drive_t *); /* 1380 4 */ void (*resetproc)(ide_drive_t *); /* 1384 4 */ void (*intrproc)(ide_drive_t *); /* 1388 4 */ void (*maskproc)(ide_drive_t *, int); /* 1392 4 */ int (*quirkproc)(ide_drive_t *); /* 1396 4 */ int (*busproc)(ide_drive_t *, int); /* 1400 4 */ void (*ata_input_data)(ide_drive_t *, void *, u32); /* 1404 4 */ /* --- cacheline 22 boundary (1408 bytes) --- */ void (*ata_output_data)(ide_drive_t *, void *, u32); /* 1408 4 */ void (*atapi_input_bytes)(ide_drive_t *, void *, u32); /* 1412 4 */ void (*atapi_output_bytes)(ide_drive_t *, void *, u32); /* 1416 4 */ int (*dma_setup)(ide_drive_t *); /* 1420 4 */ void (*dma_exec_cmd)(ide_drive_t *, u8); /* 1424 4 */ void (*dma_start)(ide_drive_t *); /* 1428 4 */ int (*ide_dma_end)(ide_drive_t *); /* 1432 4 */ int (*ide_dma_check)(ide_drive_t *); /* 1436 4 */ int (*ide_dma_on)(ide_drive_t *); /* 1440 4 */ int (*ide_dma_off_quietly)(ide_drive_t *); /* 1444 4 */ int (*ide_dma_test_irq)(ide_drive_t *); /* 1448 4 */ int (*ide_dma_host_on)(ide_drive_t *); /* 1452 4 */ int (*ide_dma_host_off)(ide_drive_t *); /* 1456 4 */ int (*ide_dma_lostirq)(ide_drive_t *); /* 1460 4 */ int (*ide_dma_timeout)(ide_drive_t *); /* 1464 4 */ void (*OUTB)(u8, long unsigned int); /* 1468 4 */ /* --- cacheline 23 boundary (1472 bytes) --- */ void (*OUTBSYNC)(ide_drive_t *, u8, long unsigned int); /* 1472 4 */ void (*OUTW)(u16, long unsigned int); /* 1476 4 */ void (*OUTL)(u32, long unsigned int); /* 1480 4 */ void (*OUTSW)(long unsigned int, void *, u32); /* 1484 4 */ void (*OUTSL)(long unsigned int, void *, u32); /* 1488 4 */ u8 (*INB)(long unsigned int); /* 1492 4 */ u16 (*INW)(long unsigned int); /* 1496 4 */ u32 (*INL)(long unsigned int); /* 1500 4 */ void (*INSW)(long unsigned int, void *, u32); /* 1504 4 */ void (*INSL)(long unsigned int, void *, u32); /* 1508 4 */ unsigned int * dmatable_cpu; /* 1512 4 */ dma_addr_t dmatable_dma; /* 1516 4 */ struct scatterlist * sg_table; /* 1520 4 */ int sg_max_nents; /* 1524 4 */ int sg_nents; /* 1528 4 */ int sg_dma_direction; /* 1532 4 */ /* --- cacheline 24 boundary (1536 bytes) --- */ int data_phase; /* 1536 4 */ unsigned int nsect; /* 1540 4 */ unsigned int nleft; /* 1544 4 */ unsigned int cursg; /* 1548 4 */ unsigned int cursg_ofs; /* 1552 4 */ int mmio; /* 1556 4 */ int rqsize; /* 1560 4 */ int irq; /* 1564 4 */ long unsigned int dma_master; /* 1568 4 */ long unsigned int dma_base; /* 1572 4 */ long unsigned int dma_command; /* 1576 4 */ long unsigned int dma_vendor1; /* 1580 4 */ long unsigned int dma_status; /* 1584 4 */ long unsigned int dma_vendor3; /* 1588 4 */ long unsigned int dma_prdtable; /* 1592 4 */ long unsigned int config_data; /* 1596 4 */ /* --- cacheline 25 boundary (1600 bytes) --- */ long unsigned int select_data; /* 1600 4 */ long unsigned int extra_base; /* 1604 4 */ unsigned int extra_ports; /* 1608 4 */ unsigned int noprobe:1; /* 1612 4 */ unsigned int present:1; /* 1612 4 */ unsigned int hold:1; /* 1612 4 */ unsigned int serialized:1; /* 1612 4 */ unsigned int sharing_irq:1; /* 1612 4 */ unsigned int reset:1; /* 1612 4 */ unsigned int autodma:1; /* 1612 4 */ unsigned int udma_four:1; /* 1612 4 */ unsigned int no_lba48:1; /* 1612 4 */ unsigned int no_lba48_dma:1; /* 1612 4 */ unsigned int no_dsc:1; /* 1612 4 */ unsigned int auto_poll:1; /* 1612 4 */ unsigned int sg_mapped:1; /* 1612 4 */ unsigned int no_io_32bit:1; /* 1612 4 */ unsigned int err_stops_fifo:1; /* 1612 4 */ unsigned int atapi_irq_bogon:1; /* 1612 4 */ /* XXX 16 bits hole, try to pack */ struct device gendev; /* 1616 396 */ /* --- cacheline 31 boundary (1984 bytes) was 28 bytes ago --- */ struct completion gendev_rel_comp; /* 2012 28 */ void * hwif_data; /* 2040 4 */ unsigned int dma; /* 2044 4 */ /* --- cacheline 32 boundary (2048 bytes) --- */ }; /* size: 2048, cachelines: 32 */ /* sum members: 2047, holes: 2, sum holes: 1 */ /* bit holes: 1, sum bit holes: 16 bits */ /* saved 4 bytes and 1 cacheline! */