1. 04 3月, 2016 16 次提交
  2. 03 3月, 2016 1 次提交
    • J
      Merge tag 'nbd-for-4.6' of git://git.pengutronix.de/git/mpa/linux-nbd into for-4.6/drivers · ff482f7f
      Jens Axboe 提交于
      NBD for 4.6
      
      Markus writes:
      
      This pull request contains 7 patches for 4.6.
      
      Patch 1 fixes some unnecessarily complicated code I introduced some versions
      ago for debugfs.
      
      Patch 2 removes the criticised signal usage within NBD to kill the NBD threads
      after a timeout. This code was used for the last years and is now replaced by
      simply killing the tcp connection.
      
      Patches 3-6 are some smaller cleanups.
      
      Patch 7 uevents for the userspace. This way udev/systemd can react on connected
      NBD devices.
      ff482f7f
  3. 01 3月, 2016 1 次提交
  4. 29 2月, 2016 4 次提交
  5. 15 2月, 2016 1 次提交
    • M
      nbd: Create size change events for userspace · 37091fdd
      Markus Pargmann 提交于
      The userspace needs to know when nbd devices are ready for use.
      Currently no events are created for the userspace which doesn't work for
      systemd.
      
      See the discussion here: https://github.com/systemd/systemd/pull/358
      
      This patch uses a central point to setup the nbd-internal sizes. A ioctl
      to set a size does not lead to a visible size change. The size of the
      block device will be kept at 0 until nbd is connected. As soon as it
      connects, the size will be changed to the real value and a uevent is
      created. When disconnecting, the blockdevice is set to 0 size and
      another uevent is generated.
      Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de>
      37091fdd
  6. 11 2月, 2016 4 次提交
  7. 10 2月, 2016 4 次提交
  8. 05 2月, 2016 9 次提交
    • D
      nbd: ratelimit error msgs after socket close · da6ccaaa
      Dan Streetman 提交于
      Make the "Attempted send on closed socket" error messages generated in
      nbd_request_handler() ratelimited.
      
      When the nbd socket is shutdown, the nbd_request_handler() function emits
      an error message for every request remaining in its queue.  If the queue
      is large, this will spam a large amount of messages to the log.  There's
      no need for a separate error message for each request, so this patch
      ratelimits it.
      
      In the specific case this was found, the system was virtual and the error
      messages were logged to the serial port, which overwhelmed it.
      
      Fixes: 4d48a542 ("nbd: fix I/O hang on disconnected nbds")
      Signed-off-by: NDan Streetman <dan.streetman@canonical.com>
      Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de>
      da6ccaaa
    • M
      nbd: Move flag parsing to a function · d02cf531
      Markus Pargmann 提交于
      nbd changes properties of the blockdevice depending on flags that were
      received. This patch moves this flag parsing into a separate function
      nbd_parse_flags().
      Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de>
      d02cf531
    • M
      nbd: Cleanup reset of nbd and bdev after a disconnect · 0e4f0f6f
      Markus Pargmann 提交于
      Group all variables that are reset after a disconnect into reset
      functions. This patch adds two of these functions, nbd_reset() and
      nbd_bdev_reset().
      Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de>
      0e4f0f6f
    • M
      nbd: Timeouts are not user requested disconnects · 1f7b5cf1
      Markus Pargmann 提交于
      It may be useful to know in the client that a connection timed out. The
      current code returns success for a timeout.
      
      This patch reports the error code -ETIMEDOUT for a timeout.
      Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de>
      1f7b5cf1
    • M
      nbd: Remove signal usage · 23272a67
      Markus Pargmann 提交于
      As discussed on the mailing list, the usage of signals for timeout
      handling has a lot of potential issues. The nbd driver used for some
      time signals for timeouts. These signals where able to get the threads
      out of the blocking socket operations.
      
      This patch removes all signal usage and uses a socket shutdown instead.
      The socket descriptor itself is cleared later when the whole nbd device
      is closed.
      
      The tasks_lock is removed as we do not depend on this anymore. Instead
      a new lock for the socket is introduced so we can safely work with the
      socket in the timeout handler outside of the two main threads.
      
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      23272a67
    • J
      cfq-iosched: Allow parent cgroup to preempt its child · 3984aa55
      Jan Kara 提交于
      Currently we don't allow sync workload of one cgroup to preempt sync
      workload of any other cgroup. This is because we want to achieve service
      separation between cgroups. However in cases where cgroup preempting is
      ancestor of the current cgroup, there is no need of separation and
      idling introduces unnecessary overhead. This hurts for example the case
      when workload is isolated within a cgroup but journalling threads are in
      root cgroup. Simple way to demostrate the issue is using:
      
      dbench4 -c /usr/share/dbench4/client.txt -t 10 -D /mnt 1
      
      on ext4 filesystem on plain SATA drive (mounted with barrier=0 to make
      difference more visible). When all processes are in the root cgroup,
      reported throughput is 153.132 MB/sec. When dbench process gets its own
      blkio cgroup, reported throughput drops to 26.1006 MB/sec.
      
      Fix the problem by making check in cfq_should_preempt() more benevolent
      and allow preemption by ancestor cgroup. This improves the throughput
      reported by dbench4 to 48.9106 MB/sec.
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJan Kara <jack@suse.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      3984aa55
    • J
      cfq-iosched: Allow sync noidle workloads to preempt each other · a257ae3e
      Jan Kara 提交于
      The original idea with preemption of sync noidle queues (introduced in
      commit 718eee05 "cfq-iosched: fairness for sync no-idle queues") was
      that we service all sync noidle queues together, we don't idle on any of
      the queues individually and we idle only if there is no sync noidle
      queue to be served. This intention also matches the original test:
      
      	if (cfqd->serving_type == SYNC_NOIDLE_WORKLOAD
      	   && new_cfqq->service_tree == cfqq->service_tree)
      		return true;
      
      However since at that time cfqq->service_tree was not set for idling
      queues, this test was unreliable and was replaced in commit e4a22919
      "cfq-iosched: fix no-idle preemption logic" by:
      
      	if (cfqd->serving_type == SYNC_NOIDLE_WORKLOAD &&
      	    cfqq_type(new_cfqq) == SYNC_NOIDLE_WORKLOAD &&
      	    new_cfqq->service_tree->count == 1)
      		return true;
      
      That was a reliable test but was actually doing something different -
      now we preempt sync noidle queue only if the new queue is the only one
      busy in the service tree.
      
      These days cfq queue is kept in service tree even if it is idling and
      thus the original check would be safe again. But since we actually check
      that cfq queues are in the same cgroup, of the same priority class and
      workload type (sync noidle), we know that new_cfqq is fine to preempt
      cfqq. So just remove the service tree check.
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJan Kara <jack@suse.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      a257ae3e
    • J
      cfq-iosched: Reorder checks in cfq_should_preempt() · 6c80731c
      Jan Kara 提交于
      Move check for preemption by rt class up. There is no functional change
      but it makes arguing about conditions simpler since we can be sure both
      cfq queues are from the same ioprio class.
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJan Kara <jack@suse.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      6c80731c
    • J
      cfq-iosched: Don't group_idle if cfqq has big thinktime · e795421e
      Jan Kara 提交于
      There is no point in idling on a cfq group if the only cfq queue that is
      there has too big thinktime.
      Signed-off-by: NJan Kara <jack@suse.com>
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      e795421e