04 Oct, 2009
3 commits
-
Not all users of the topology information want to use libblkid. Provide
the topology information through bdev ioctls.Also clarify sector size comments for existing BLK ioctls.
Signed-off-by: Martin K. Petersen
Signed-off-by: Jens Axboe -
We should use the sysfs modified slice sync value, in case it differs
from the default.Signed-off-by: Jens Axboe
-
Don't think that's necessarily a perfect description of what this
option fiddles with, but it's probably better than 'desktop'.Signed-off-by: Jens Axboe
03 Oct, 2009
3 commits
-
This slowly ramps up the async queue depth based on the time
passed since the sync IO, and doesn't allow async at all until
a sync slice period has passed.Signed-off-by: Jens Axboe
-
o Do not allow more than max_dispatch requests from an async queue, if some
sync request has finished recently. This is in the hope that sync activity
is still going on in the system and we might receive a sync request soon.
Most likely from a sync queue which finished a request and we did not enable
idling on it.Signed-off-by: Vivek Goyal
Signed-off-by: Jens Axboe -
This is basically identical to what Vivek Goyal posted, but combined
into one and labelled 'desktop' instead of 'fairness'. The goal
is to continue to improve on the latency side of things as it relates
to interactiveness, keeping the questionable bits under this sysfs
tunable so it would be easy for throughput-only people to turn off.Apart from adding the interactive sysfs knob, it also adds the
behavioural change of allowing slice idling even if the hardware
does tagged command queuing.Signed-off-by: Jens Axboe
02 Oct, 2009
33 commits
-
Since 2.6.31 now has request-based device-mapper, it's useful to have
a tracepoint for request-remapping as well as bio-remapping.
This patch adds a tracepoint for request-remapping, trace_block_rq_remap().Signed-off-by: Kiyoshi Ueda
Signed-off-by: Jun'ichi Nomura
Cc: Alasdair G Kergon
Cc: Li Zefan
Signed-off-by: Jens Axboe -
Currently we set the bio size to the byte equivalent of the blocks to
be trimmed when submitting the initial DISCARD ioctl. That means it
is subject to the max_hw_sectors limitation of the HBA which is
much lower than the size of a DISCARD request we can support.
Add a separate max_discard_sectors tunable to limit the size for discard
requests.We limit the max discard request size in bytes to 32bit as that is the
limit for bio->bi_size. This could be much larger if we had a way to pass
that information through the block layer.Signed-off-by: Christoph Hellwig
Signed-off-by: Jens Axboe -
prepare_discard_fn() was being called in a place where memory allocation
was effectively impossible. This makes it inappropriate for all but
the most trivial translations of Linux's DISCARD operation to the block
command set. Additionally adding a payload there makes the ownership
of the bio backing unclear as it's now allocated by the device driver
and not the submitter as usual.It is replaced with QUEUE_FLAG_DISCARD which is used to indicate whether
the queue supports discard operations or not. blkdev_issue_discard now
allocates a one-page, sector-length payload which is the right thing
for the common ATA and SCSI implementations.The mtd implementation of prepare_discard_fn() is replaced with simply
checking for the request being a discard.Largely based on a previous patch from Matthew Wilcox
which did the prepare_discard_fn but not the different payload allocation
yet.Signed-off-by: Christoph Hellwig
Signed-off-by: Jens Axboe -
While testing Swap over NFS patchset, I noticed an oops that was triggered
during swapon. Investigating further, the NULL pointer deference is due to the
SSD device check/optimization in the swapon code that assumes s_bdev could never
be NULL.inode->i_sb->s_bdev could be NULL in a few cases. For e.g. one such case is
loopback NFS mount, there could be others as well. Fix this by ensuring s_bdev
is not NULL before we try to deference s_bdev.Signed-off-by: Suresh Jayaraman
Signed-off-by: Jens Axboe -
As mentioned in Documentation/CodingStyle, move EXPORT* macro's
to the line immediately after the closing function brace line.Signed-off-by: H Hartley Sweeten
Signed-off-by: Jens Axboe -
Add missing blk_trace_remove_sysfs to be in pair with blk_trace_init_sysfs
introduced in commit 1d54ad6da9192fed5dd3b60224d9f2dfea0dcd82.
Release kobject also in case the request_fn is NULL.Problem was noticed via kmemleak backtrace when some sysfs entries were
note properly destroyed during device removal:unreferenced object 0xffff88001aa76640 (size 80):
comm "lvcreate", pid 2120, jiffies 4294885144
hex dump (first 32 bytes):
01 00 00 00 00 00 00 00 f0 65 a7 1a 00 88 ff ff .........e......
90 66 a7 1a 00 88 ff ff 86 1d 53 81 ff ff ff ff .f........S.....
backtrace:
[] kmemleak_alloc+0x26/0x60
[] kmem_cache_alloc+0x133/0x1c0
[] sysfs_new_dirent+0x41/0x120
[] sysfs_add_file_mode+0x3c/0xb0
[] internal_create_group+0xc1/0x1a0
[] sysfs_create_group+0x13/0x20
[] blk_trace_init_sysfs+0x14/0x20
[] blk_register_queue+0x3c/0xf0
[] add_disk+0x94/0x160
[] dm_create+0x598/0x6e0 [dm_mod]
[] dev_create+0x51/0x350 [dm_mod]
[] ctl_ioctl+0x1a3/0x240 [dm_mod]
[] dm_compat_ctl_ioctl+0x12/0x20 [dm_mod]
[] compat_sys_ioctl+0xcd/0x4f0
[] sysenter_dispatch+0x7/0x2c
[] 0xffffffffffffffffSigned-off-by: Zdenek Kabelac
Reviewed-by: Li Zefan
Signed-off-by: Jens Axboe -
Fix these build errors when CONFIG_PROC_FS is not set:
drivers/block/cciss.c: In function 'cciss_show_raid_level':
drivers/block/cciss.c:623: error: 'RAID_UNKNOWN' undeclared (first use in this function)
drivers/block/cciss.c:626: error: 'raid_label' undeclared (first use in this function)
drivers/block/cciss.c: In function 'cciss_geometry_inquiry':
drivers/block/cciss.c:2696: error: 'RAID_UNKNOWN' undeclared (first use in this function)Signed-off-by: Alexander Beregalov
Signed-off-by: Jens Axboe -
Stacking devices do not have an inherent max_hw_sector limit. Set the
default to INT_MAX so we are bounded only by capabilities of the
underlying storage.Signed-off-by: Martin K. Petersen
Signed-off-by: Jens Axboe -
The topology changes unintentionally caused SAFE_MAX_SECTORS to be set
for stacking devices. Set the default limit to BLK_DEF_MAX_SECTORS and
provide SAFE_MAX_SECTORS in blk_queue_make_request() for legacy hw
drivers that depend on the old behavior.Acked-by: Mike Snitzer
Signed-off-by: Martin K. Petersen
Signed-off-by: Jens Axboe -
Signed-off-by: Jens Axboe
-
cciss: Dynamically allocate the drive_info_struct for each logical drive.
This reduces the size of the per-hba ctlr_info structure from 106936
bytes to 8132 bytes. That's on 32-bit systems. On 64-bit systems, the
improvement is even bigger. Without this, the ctlr_info struct is so big
that the driver won't even load on a 64 bit system if CISS_MAX_LUN was
at it's current setting of 1024 logical drives.Signed-off-by: Stephen M. Cameron
Signed-off-by: Jens Axboe -
Add usage_count attribute to each logical drive at
/sys/devices//ccissX/cXdY/usage_count for controller X,
logical drive Y. The usage count is the number of times
the device has currently been opened.Signed-off-by: Stephen M. Cameron
Signed-off-by: Jens Axboe -
and change get rid of some magic numbers in raid lavel decoding.
Add raid_level attribute to each logical drive at
/sys/devices//ccissX/cXdY/raid_level for controller X,
logical drive YSigned-off-by: Stephen M. Cameron
Signed-off-by: Jens Axboe -
cciss: fix some magic numbers in the raid-level decoding
Signed-off-by: Stephen M. Cameron
Signed-off-by: Jens Axboe -
Add lunid attribute to each logical drive at
/sys/devices//ccissX/cXdY/lunid for controller X,
logical drive YSigned-off-by: Stephen M. Cameron
Signed-off-by: Jens Axboe -
Don't check h->busy_initializing in cciss_open(). Open won't be
called before things are ready, but h->busy_initializing won't be
unset until after the initial rebuild_lun_table is finished. But,
to read the partitions, cciss_open will be called for each logical
drive during rebuild_lun_table. If cciss_open checks h->busy_initializing,
then the reading of the partition information during the initial
rebuild_lun_table will fail, which is especially bad news if it
happens to be your boot device.Signed-off-by: Stephen M. Cameron
Signed-off-by: Jens Axboe -
Preserve all 8 bytes of the LunID field returned
by CCISS_REPORT_LOGICAL instead of only saving 4 bytes.
This fixes a bug with logical volume addressing encountered on
an MSA2012.Signed-off-by: Stephen M. Cameron
Signed-off-by: Jens Axboe -
Silence noisy per-disk messages output by cciss_read_capacity
Signed-off-by: Stephen M. Cameron
Signed-off-by: Jens Axboe -
Fix bug that free_hba was calling put_disk for all gendisk[]
pointers -- all 1024 of them -- regardless of whether the were
used or not (NULL). This bug could cause rmmod to oops if logical
drives had been deleted during the driver's lifetime.Signed-off-by: Stephen M. Cameron
Signed-off-by: Jens Axboe -
When rebuild_lun_table is reached via sysfs, the usage count that
is checked prior to messing with c0d0 has different constraints
(must be zero) than if rebuild_lun_table is reached via ioctl
(must be one.) Fix rebuild_lun_table to take that into account.Signed-off-by: Stephen M. Cameron
Signed-off-by: Jens Axboe -
When removing a logical drive, clear all the information that is
now exposed by sysfs (e.g. vendor, model, serial number.)Signed-off-by: Stephen M. Cameron
Signed-off-by: Jens Axboe -
For c0dx where x is not 0, we handle deletion and addition simply,
but for c0d0, there is the special case that even when there's no
disk, the device node exists so that the controller may be accessed.
So, for c0d0, we only create the sysfs entries once, when a controller
is added, and only remove them once, when a controller is being
taken down.Signed-off-by: Stephen M. Cameron
Signed-off-by: Jens Axboe -
Handle cases when cciss_add_disk fails.
Signed-off-by: Stephen M. Cameron
Signed-off-by: Jens Axboe -
Handle failure of blk_init_queue gracefully in cciss_add_disk.
Signed-off-by: Stephen M. Cameron
Signed-off-by: Jens Axboe -
Rearrange logical drive sysfs code to make the "changing a disk" path work.
Signed-off-by: Stephen M. Cameron
Signed-off-by: Jens Axboe -
Dynamically allocate struct device for each logical drive as needed
instead of allocating the maximum we would ever need at driver init time.Signed-off-by: Stephen M. Cameron
Signed-off-by: Jens Axboe -
Remove some unused code in rebuild_lun_table()
Signed-off-by: Stephen M. Cameron
Signed-off-by: Jens Axboe -
Added /sys/bus/pci/devices//ccissX/rescan sysfs entry used
to kick off a rescan that discovers logical drive topology changes.Signed-off-by: Andrew Patterson
Signed-off-by: Stephen M. Cameron
Acked-by: Mike Miller
Signed-off-by: Jens Axboe -
Replace the use of one scan kthread per controller with one per driver.
Use a queue to hold a list of controllers that need to be rescanned with
routines to add and remove controllers from the queue.Fix locking and completion handling to prevent a hang during rmmod.
Signed-off-by: Andrew Patterson
Signed-off-by: Stephen M. Cameron
Acked-by: Mike Miller
Signed-off-by: Jens Axboe -
Sysfs entries for logical drives need to be removed when a drive is
deleted during driver cleanup.Signed-off-by: Andrew Patterson
Signed-off-by: Stephen M. Cameron
Acked-by: Mike Miller
Signed-off-by: Jens Axboe -
Change schedule_timeout() parameter to not be specific to HZ=1000.
Signed-off-by: Randy Dunlap
Acked-by: Mike Miller
Cc: Marcin Slusarz
Cc: "Cameron, Steve"
Signed-off-by: Andrew Morton
Signed-off-by: Jens Axboe -
Signed-off-by: Alexey Dobriyan
Cc: Yang Hongyang
Cc: Tejun Heo
Signed-off-by: Andrew Morton
Signed-off-by: Jens Axboe -
Signed-off-by: Alexey Dobriyan
Cc: Chirag Kantharia
Cc: Tejun Heo
Cc: Grant Likely
Signed-off-by: Andrew Morton
Signed-off-by: Jens Axboe
28 Sep, 2009
1 commit