Re: libata/sata_sil24 cache alignment problem?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> I hadn't considered that approach due to the way the ata_port is allocated:
> 
> > libata-core.c:
> >         host = scsi_host_alloc(ent->sht, sizeof(struct ata_port));
> > 
> > hosts.c:
> > struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
> > {
> >         shost = kzalloc(sizeof(struct Scsi_Host) + privsize, gfp_mask);
> > }
> 
> The ata_port allocation is tacked onto the end of the Scsi_Host
> allocation, so the start of ata_port will only be cache aligned if the
> end of the Scsi_Host struct is, although that would be easy enough to
> fix since it's currently aligned to an unsigned long boundary.

You are right.

> I like that approach better, since it's clearer what the intent is,
> and it's easier.  Is there any other way that the ata_port struct
> might be used that would invalidate this?  

I can't think of one. The object lifetime is right - the ata_port is
created before the port buffer is used and destroyed after it is finished
(obviously or embedding it in the struct wouldn't work either)

Alan
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux