1. 01 May, 2011 25 commits
  2. 15 Apr, 2011 13 commits
  3. 14 Apr, 2011 2 commits
    • Ben Hutchings's avatar
      mm/thp: use conventional format for boolean attributes · e27e6151
      Ben Hutchings authored
      The conventional format for boolean attributes in sysfs is numeric ("0" or
      "1" followed by new-line).  Any boolean attribute can then be read and
      written using a generic function.  Using the strings "yes [no]", "[yes]
      no" (read), "yes" and "no" (write) will frustrate this.
      
      [akpm@linux-foundation.org: use kstrtoul()]
      [akpm@linux-foundation.org: test_bit() doesn't return 1/0, per Neil]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Mel Gorman <mel@csn.ul.ie>
      Cc: Johannes Weiner <jweiner@redhat.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Hugh Dickins <hughd@google.com>
      Tested-by: default avatarDavid Rientjes <rientjes@google.com>
      Cc: NeilBrown <neilb@suse.de>
      Cc: <stable@kernel.org> 	[2.6.38.x]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e27e6151
    • Bob Liu's avatar
      ramfs: fix memleak on no-mmu arch · b836aec5
      Bob Liu authored
      On no-mmu arch, there is a memleak during shmem test.  The cause of this
      memleak is ramfs_nommu_expand_for_mapping() added page refcount to 2
      which makes iput() can't free that pages.
      
      The simple test file is like this:
      
        int main(void)
        {
      	int i;
      	key_t k = ftok("/etc", 42);
      
      	for ( i=0; i<100; ++i) {
      		int id = shmget(k, 10000, 0644|IPC_CREAT);
      		if (id == -1) {
      			printf("shmget error\n");
      		}
      		if(shmctl(id, IPC_RMID, NULL ) == -1) {
      			printf("shm  rm error\n");
      			return -1;
      		}
      	}
      	printf("run ok...\n");
      	return 0;
        }
      
      And the result:
      
        root:/> free
                     total         used         free       shared      buffers
        Mem:         60320        17912        42408            0            0
        -/+ buffers:              17912        42408
        root:/> shmem
        run ok...
        root:/> free
                     total         used         free       shared      buffers
        Mem:         60320        19096        41224            0            0
        -/+ buffers:              19096        41224
        root:/> shmem
        run ok...
        root:/> free
                     total         used         free       shared      buffers
        Mem:         60320        20296        40024            0            0
        -/+ buffers:              20296        40024
        ...
      
      After this patch the test result is:(no memleak anymore)
      
        root:/> free
                     total         used         free       shared      buffers
        Mem:         60320        16668        43652            0            0
        -/+ buffers:              16668        43652
        root:/> shmem
        run ok...
        root:/> free
                     total         used         free       shared      buffers
        Mem:         60320        16668        43652            0            0
        -/+ buffers:              16668        43652
      Signed-off-by: default avatarBob Liu <lliubbo@gmail.com>
      Acked-by: default avatarHugh Dickins <hughd@google.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Cc: <stable@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b836aec5