Re: [PATCH scsi-misc-2.6 04/13] scsi: remove meaningless volatile qualifiers from structure definitions

From: Christoph Hellwig
Date: Thu Mar 31 2005 - 05:14:05 EST


On Thu, Mar 31, 2005 at 06:08:10PM +0900, Tejun Heo wrote:
> struct list_head siblings; /* list of all devices on this host */
> struct list_head same_target_siblings; /* just the devices sharing same target id */
>
> - volatile unsigned short device_busy; /* commands actually active on low-level */
> + unsigned short device_busy; /* commands actually active on
> + * low-level. protected by sdev_lock. */

You should probably switch it to just unsigned. The other 16bit are wasted
due to alignment anyway, and some architectures produce better code for 32bit
accesses.

> - volatile unsigned short host_busy; /* commands actually active on low-level */
> - volatile unsigned short host_failed; /* commands that failed. */
> +
> + /*
> + * The following two fields are protected with host_lock;
> + * however, eh routines can safely access during eh processing
> + * without acquiring the lock.
> + */
> + unsigned short host_busy; /* commands actually active on low-level */
> + unsigned short host_failed; /* commands that failed. */

Here it would actually increase the struct size but might make sense anyway.

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