1. 07 4月, 2009 5 次提交
    • P
      nilfs2: clean up indirect function calling conventions · 8acfbf09
      Pekka Enberg 提交于
      This cleans up the strange indirect function calling convention used in
      nilfs to follow the normal kernel coding style.
      Signed-off-by: NPekka Enberg <penberg@cs.helsinki.fi>
      Acked-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8acfbf09
    • R
      nilfs2: fix gc failure on volumes keeping numerous snapshots · b028fcfc
      Ryusuke Konishi 提交于
      This resolves the following failure of nilfs2 cleaner daemon:
      
       nilfs_cleanerd[20670]: cannot clean segments: No such file or directory
       nilfs_cleanerd[20670]: shutdown
      
      When creating thousands of snapshots, the cleaner daemon had rarely died
      as above due to an error returned from the kernel code.
      
      After applying the recent patch which fixed memory allocation problems in
      ioctl (Message-Id: <20081215.155840.105124170.ryusuke@osrg.net>), the
      problem gets more frequent.
      
      It turned out to be a bug of nilfs_ioctl_wrap_copy function and one of its
      callback routines to read out information of snapshots; if the
      nilfs_ioctl_wrap_copy function divided a large read request into multiple
      requests, the second and later requests have failed since a restart
      position on snapshot meta data was not properly set forward.
      
      It's a deficiency of the callback interface that cannot pass the restart
      position among multiple requests.  This patch fixes the issue by allowing
      nilfs_ioctl_wrap_copy and snapshot read functions to exchange a position
      argument.
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b028fcfc
    • R
      nilfs2: avoid double error caused by nilfs_transaction_end · 47420c79
      Ryusuke Konishi 提交于
      Pekka Enberg pointed out that double error handlings found after
      nilfs_transaction_end() can be avoided by separating abort operation:
      
       OK, I don't understand this. The only way nilfs_transaction_end() can
       fail is if we have NILFS_TI_SYNC set and we fail to construct the
       segment. But why do we want to construct a segment if we don't commit?
      
       I guess what I'm asking is why don't we have a separate
       nilfs_transaction_abort() function that can't fail for the erroneous
       case to avoid this double error value tracking thing?
      
      This does the separation and renames nilfs_transaction_end() to
      nilfs_transaction_commit() for clarification.
      
      Since, some calls of these functions were used just for exclusion control
      against the segment constructor, they are replaced with semaphore
      operations.
      Acked-by: NPekka Enberg <penberg@cs.helsinki.fi>
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      47420c79
    • R
      nilfs2: fix problems of memory allocation in ioctl · 3358b4aa
      Ryusuke Konishi 提交于
      This is another patch for fixing the following problems of a memory
      copy function in nilfs2 ioctl:
      
      (1) It tries to allocate 128KB size of memory even for small objects.
      
      (2) Though the function repeatedly tries large memory allocations
          while reducing the size, GFP_NOWAIT flag is not specified.
          This increases the possibility of system memory shortage.
      
      (3) During the retries of (2), verbose warnings are printed
          because _GFP_NOWARN flag is not used for the kmalloc calls.
      
      The first patch was still doing large allocations by kmalloc which are
      repeatedly tried while reducing the size.
      
      Andi Kleen told me that using copy_from_user for large memory is not
      good from the viewpoint of preempt latency:
      
       On Fri, 12 Dec 2008 21:24:11 +0100, Andi Kleen <andi@firstfloor.org> wrote:
       > > In the current interface, each data item is copied twice: one is to
       > > the allocated memory from user space (via copy_from_user), and another
       >
       > For such large copies it is better to use multiple smaller (e.g. 4K)
       > copy user, that gives better real time preempt latencies. Each cfu has a
       > cond_resched(), but only one, not multiple times in the inner loop.
      
      He also advised me that:
      
       On Sun, 14 Dec 2008 16:13:27 +0100, Andi Kleen <andi@firstfloor.org> wrote:
       > Better would be if you could go to PAGE_SIZE. order 0 allocations
       > are typically the fastest / least likely to stall.
       >
       > Also in this case it's a good idea to use __get_free_pages()
       > directly, kmalloc tends to be become less efficient at larger
       > sizes.
      
      For the function in question, the size of buffer memory can be reduced
      since the buffer is repeatedly used for a number of small objects.  On
      the other hand, it may incur large preempt latencies for larger buffer
      because a copy_from_user (and a copy_to_user) was applied only once
      each cycle.
      
      With that, this revision uses the order 0 allocations with
      __get_free_pages() to fix the original problems.
      
      Cc: Andi Kleen <andi@firstfloor.org>
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3358b4aa
    • K
      nilfs2: ioctl operations · 7942b919
      Koji Sato 提交于
      This adds userland interface implemented with ioctl.
      Signed-off-by: NKoji Sato <sato.koji@lab.ntt.co.jp>
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7942b919