Re: [PATCH] scsi: iterate over devices individually for /proc/scsi/scsi

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

 



On Thu, Apr 12, 2007 at 03:34:32PM -0400, Jeff Mahoney wrote:
>  On systems with very large numbers (> 1600 or so) of SCSI devices,
>  cat /proc/scsi/scsi ends up failing with -ENOMEM. This is due to
>  the show routine simply iterating over all of the devices with
>  bus_for_each_dev(), and trying to dump all of them into the buffer
>  at the same time. On my test system (using scsi_debug with 4064 devices),
>  the output ends up being ~ 632k, far more than kmalloc will typically allow.
> 
>  This patch uses seq_file directly instead of single_file, and breaks up
>  the operations into the 4 seq_file callbacks. The result is that
>  each show() operation only dumps ~ 180 bytes into the buffer at a time
>  so we don't run out of memory.

The simpler answer is don't use /proc/scsi/scsi, but lsscsi instead.
It even has an option to provide /proc/scsi/scsi-style output.

This already came up the last time someone from SuSE sent a patch
to fix an "issue" like that.  That time at least the patch was
massageable into something sane, which this one isn't.  So please
take the advice this time and stop using /proc/scsi/scsi.

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux