1. 26 10月, 2011 1 次提交
  2. 29 9月, 2011 1 次提交
    • S
      xen: modify kernel mappings corresponding to granted pages · 0930bba6
      Stefano Stabellini 提交于
      If we want to use granted pages for AIO, changing the mappings of a user
      vma and the corresponding p2m is not enough, we also need to update the
      kernel mappings accordingly.
      Currently this is only needed for pages that are created for user usages
      through /dev/xen/gntdev. As in, pages that have been in use by the
      kernel and use the P2M will not need this special mapping.
      However there are no guarantees that in the future the kernel won't
      start accessing pages through the 1:1 even for internal usage.
      
      In order to avoid the complexity of dealing with highmem, we allocated
      the pages lowmem.
      We issue a HYPERVISOR_grant_table_op right away in
      m2p_add_override and we remove the mappings using another
      HYPERVISOR_grant_table_op in m2p_remove_override.
      Considering that m2p_add_override and m2p_remove_override are called
      once per page we use multicalls and hypercall batching.
      
      Use the kmap_op pointer directly as argument to do the mapping as it is
      guaranteed to be present up until the unmapping is done.
      Before issuing any unmapping multicalls, we need to make sure that the
      mapping has already being done, because we need the kmap->handle to be
      set correctly.
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      [v1: Removed GRANT_FRAME_BIT usage]
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      0930bba6
  3. 21 9月, 2011 1 次提交
  4. 15 9月, 2011 4 次提交
  5. 22 8月, 2011 2 次提交
    • J
      xen-blkback: fixed indentation and comments · 1bc05b0a
      Joe Jin 提交于
      This patch fixes belows:
      
      1. Fix code style issue.
      2. Fix incorrect functions name in comments.
      Signed-off-by: NJoe Jin <joe.jin@oracle.com>
      Cc: Jens Axboe <jaxboe@fusionio.com>
      Cc: Ian Campbell <Ian.Campbell@eu.citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      1bc05b0a
    • J
      xen-blkback: Don't disconnect backend until state switched to XenbusStateClosed. · 6f5986bc
      Joe Jin 提交于
      When do block-attach/block-detach test with below steps, umount hangs
      in the guest. Furthermore shutdown ends up being stuck when umounting file-systems.
      
      1. start guest.
      2. attach new block device by xm block-attach in Dom0.
      3. mount new disk in guest.
      4. execute xm block-detach to detach the block device in dom0 until timeout
      5. Any request to the disk will hung.
      
      Root cause:
      This issue is caused when setting backend device's state to
      'XenbusStateClosing', which sends to the frontend the XenbusStateClosing
      notification. When frontend receives the notification it tries to release
      the disk in blkfront_closing(), but at that moment the disk is still in use
      by guest, so frontend refuses to close. Specifically it sets the disk state to
      XenbusStateClosing and sends the notification to backend - when backend receives the
      event, it disconnects the vbd from real device, and sets the vbd device state to
      XenbusStateClosing. The backend disconnects the real device/file, and any IO
      requests to the disk in guest will end up in ether, leaving disk DEAD and set to
      XenbusStateClosing. When the guest wants to disconnect the disk, umount will
      hang on blkif_release()->xlvbd_release_gendisk() as it is unable to send any IO
      to the disk, which prevents clean system shutdown.
      
      Solution:
      Don't disconnect backend until frontend state switched to XenbusStateClosed.
      Signed-off-by: NJoe Jin <joe.jin@oracle.com>
      Cc: Daniel Stodden <daniel.stodden@citrix.com>
      Cc: Jens Axboe <jaxboe@fusionio.com>
      Cc: Annie Li <annie.li@oracle.com>
      Cc: Ian Campbell <Ian.Campbell@eu.citrix.com>
      [v1: Modified description a bit]
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      6f5986bc
  6. 09 8月, 2011 1 次提交
  7. 03 8月, 2011 1 次提交
  8. 02 8月, 2011 1 次提交
  9. 01 8月, 2011 4 次提交
    • K
      loop: fix deadlock when sysfs and LOOP_CLR_FD race against each other · 05eb0f25
      Kay Sievers 提交于
      LOOP_CLR_FD takes lo->lo_ctl_mutex and tries to remove the loop sysfs
      files. Sysfs calls show() and waits for lo->lo_ctl_mutex. LOOP_CLR_FD
      waits for show() to finish to remove the sysfs file.
      
        cat /sys/class/block/loop0/loop/backing_file
          mutex_lock_nested+0x176/0x350
          ? loop_attr_do_show_backing_file+0x2f/0xd0 [loop]
          ? loop_attr_do_show_backing_file+0x2f/0xd0 [loop]
          loop_attr_do_show_backing_file+0x2f/0xd0 [loop]
          dev_attr_show+0x1b/0x60
          ? sysfs_read_file+0x86/0x1a0
          ? __get_free_pages+0x12/0x50
          sysfs_read_file+0xaf/0x1a0
      
        ioctl(LOOP_CLR_FD):
          wait_for_common+0x12c/0x180
          ? try_to_wake_up+0x2a0/0x2a0
          wait_for_completion+0x18/0x20
          sysfs_deactivate+0x178/0x180
          ? sysfs_addrm_finish+0x43/0x70
          ? sysfs_addrm_start+0x1d/0x20
          sysfs_addrm_finish+0x43/0x70
          sysfs_hash_and_remove+0x85/0xa0
          sysfs_remove_group+0x59/0x100
          loop_clr_fd+0x1dc/0x3f0 [loop]
          lo_ioctl+0x223/0x7a0 [loop]
      
      Instead of taking the lo_ctl_mutex from sysfs code, take the inner
      lo->lo_lock, to protect the access to the backing_file data.
      
      Thanks to Tejun for help debugging and finding a solution.
      
      Cc: Milan Broz <mbroz@redhat.com>
      Cc: Tejun Heo <tj@kernel.org>
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Cc: stable@kernel.org
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      05eb0f25
    • K
      loop: add BLK_DEV_LOOP_MIN_COUNT=%i to allow distros 0 pre-allocated loop devices · d134b00b
      Kay Sievers 提交于
      Instead of unconditionally creating a fixed number of dead loop
      devices which need to be investigated by storage handling services,
      even when they are never used, we allow distros start with 0
      loop devices and have losetup(8) and similar switch to the dynamic
      /dev/loop-control interface instead of searching /dev/loop%i for free
      devices.
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      d134b00b
    • K
      loop: add management interface for on-demand device allocation · 770fe30a
      Kay Sievers 提交于
      Loop devices today have a fixed pre-allocated number of usually 8.
      The number can only be changed at module init time. To find a free
      device to use, /dev/loop%i needs to be scanned, and all devices need
      to be opened until a free one is possibly found.
      
      This adds a new /dev/loop-control device node, that allows to
      dynamically find or allocate a free device, and to add and remove loop
      devices from the running system:
       LOOP_CTL_ADD adds a specific device. Arg is the number
       of the device. It returns the device i or a negative
       error code.
      
       LOOP_CTL_REMOVE removes a specific device, Arg is the
       number the device. It returns the device i or a negative
       error code.
      
       LOOP_CTL_GET_FREE finds the next unbound device or allocates
       a new one. No arg is given. It returns the device i or a
       negative error code.
      
      The loop kernel module gets automatically loaded when
      /dev/loop-control is accessed the first time. The alias
      specified in the module, instructs udev to create this
      'dead' device node, even when the module is not loaded.
      
      Example:
       cfd = open("/dev/loop-control", O_RDWR);
      
       # add a new specific loop device
       err = ioctl(cfd, LOOP_CTL_ADD, devnr);
      
       # remove a specific loop device
       err = ioctl(cfd, LOOP_CTL_REMOVE, devnr);
      
       # find or allocate a free loop device to use
       devnr = ioctl(cfd, LOOP_CTL_GET_FREE);
      
       sprintf(loopname, "/dev/loop%i", devnr);
       ffd = open("backing-file", O_RDWR);
       lfd = open(loopname, O_RDWR);
       err = ioctl(lfd, LOOP_SET_FD, ffd);
      
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Karel Zak  <kzak@redhat.com>
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      770fe30a
    • K
      loop: replace linked list of allocated devices with an idr index · 34dd82af
      Kay Sievers 提交于
      Replace the linked list, that keeps track of allocated devices, with an
      idr index to allow a more efficient lookup of devices.
      
      Cc: Tejun Heo <tj@kernel.org>
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      34dd82af
  10. 27 7月, 2011 3 次提交
  11. 20 7月, 2011 1 次提交
  12. 15 7月, 2011 2 次提交
  13. 14 7月, 2011 1 次提交
  14. 09 7月, 2011 1 次提交
  15. 01 7月, 2011 3 次提交
  16. 30 6月, 2011 6 次提交
  17. 09 6月, 2011 1 次提交
  18. 02 6月, 2011 1 次提交
    • L
      block: fix mismerge of the DISK_EVENT_MEDIA_CHANGE removal · 0f48f260
      Linus Torvalds 提交于
      Jens' back-merge commit 698567f3 ("Merge commit 'v2.6.39' into
      for-2.6.40/core") was incorrectly done, and re-introduced the
      DISK_EVENT_MEDIA_CHANGE lines that had been removed earlier in commits
      
       - 9fd097b1 ("block: unexport DISK_EVENT_MEDIA_CHANGE for
         legacy/fringe drivers")
      
       - 7eec77a1 ("ide: unexport DISK_EVENT_MEDIA_CHANGE for ide-gd
         and ide-cd")
      
      because of conflicts with the "g->flags" updates near-by by commit
      d4dc210f ("block: don't block events on excl write for non-optical
      devices")
      
      As a result, we re-introduced the hanging behavior due to infinite disk
      media change reports.
      
      Tssk, tssk, people! Don't do back-merges at all, and *definitely* don't
      do them to hide merge conflicts from me - especially as I'm likely
      better at merging them than you are, since I do so many merges.
      Reported-by: NSteven Rostedt <rostedt@goodmis.org>
      Cc: Jens Axboe <jaxboe@fusionio.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0f48f260
  19. 01 6月, 2011 2 次提交
  20. 30 5月, 2011 2 次提交
  21. 29 5月, 2011 1 次提交
    • L
      x86 idle floppy: deprecate disable_hlt() · 3b70b2e5
      Len Brown 提交于
      Plan to remove floppy_disable_hlt in 2012, an ancient
      workaround with comments that it should be removed.
      
      This allows us to remove clutter and a run-time branch
      from the idle code.
      
      WARN_ONCE() on invocation until it is removed.
      
      cc: x86@kernel.org
      cc: stable@kernel.org # .39.x
      Signed-off-by: NLen Brown <len.brown@intel.com>
      3b70b2e5