1. 13 Oct, 2002 11 commits
    • Andrew Morton's avatar
      [PATCH] start anon pages on the active list · a5bef68d
      Andrew Morton authored
      We're currently adding anon pages to the inactive list.  But they're
      all referenced, so when they reach the tail of the inactive list the
      kernel will always then bump them up to the active list.
      
      Not only does this waste CPU, but it leads to inactive/active
      imbalance.  We end up with enormous sequences of unreclaimable,
      to-be-activated pages hitting the tail of the LRU and large amounts of
      scanning need to be done.  Which upsets the VM, making it think that it
      is "under distress".
      
      So just start them out on the active list.
      a5bef68d
    • Andrew Morton's avatar
      [PATCH] reduced and tunable swappiness · 8f7a1404
      Andrew Morton authored
      /proc/sys/vm/swappiness controls the VM's tendency to unmap pages and to
      swap things out.
      
      100 -> basically current 2.5 behaviour
      0 -> not very swappy at all
      
      The mechanism which is used to control swappiness is: to be reluctant
      to bring mapped pages onto the inactive list.  Prefer to reclaim
      pagecache instead.
      
      The control for that mechanism is as follows:
      
      - If there is a large amount of mapped memory in the machine, we
        prefer to bring mapped pages onto the inactive list.
      
      - If page reclaim is under distress (more scanning is happening) then
        prefer to bring mapped pages onto the inactive list.  This is
        basically the 2.4 algorithm, really.
      
      - If the /proc/sys/vm/swappiness control is high then prefer to bring
        mapped pages onto the inactive list.
      
      The implementation is simple: calculate the above three things as
      percentages and add them up.  If that's over 100% then start reclaiming
      mapped pages.
      
      The `proportion of mapped memory' is downgraded so that we don't swap
      just because a lot of memory is mapped into pagetables - we still need
      some VM distress before starting to swap that memory out.
      
      For a while I was adding a little bias so that we prefer to unmap
      file-backed memory before swapping out anon memory.  Because usually
      file backed memory can be evicted and reestablished with one I/O, not
      two.  It was unmapping executable text too easily, so here I just treat
      them equally.
      8f7a1404
    • Andrew Morton's avatar
      [PATCH] propagate pte reference into page reference during · 5bbac23e
      Andrew Morton authored
      zap_pte_range() is currently just dropping the pte.  Change it to mark
      the page referenced if the pte says it was.  This has the effect of
      delaying the eviction of recently-mapped pagecache.
      
      This means that we're currently marking the page accessed when it is
      first faulted in as well as when we drop it from pagetables.  Which
      matches up with the (strange) behaviour of the VM: it reclaims
      PageReferenced pagecache pages off the inactive list.
      
      Probably, it makes sense to remove the mark_page_accessed() from
      filemap_nopage() and just use the pte bits everywhere.  Reviewing all
      the PageReferenced()/mark_page_accessed() usage is on my todo list.
      5bbac23e
    • Andrew Morton's avatar
      [PATCH] small-machine writer throttling fix · 3a1bfe87
      Andrew Morton authored
      The current writer throttling in balance_dirty_pages() assumes that the
      writer will be effectively throttled on request queues.
      
      That works fine when the amount of data which can be placed into a
      queue is "much less than" total memory.
      
      But if the machine has a small amount of memory, or many disks, or has
      large request queues, or large requests, it can go wrong.
      
      For example, with mem=96m and dirty_async_ratio=15, we want to be able
      to clamp dirty+writeback memory at 15 megabytes.  But it doesn't work,
      because a single SCSI request queue can hold 40 megs or more.  The
      heavy writer keeps on dirtying memory until that queue fills up.
      
      So add a test for that - if we did some writeback, and we're *still*
      over the dirty+writeback threshold then make the caller take an
      explicit nap on some writes terminating.  And keep on doing that until
      the dirty+writeback memory subsides.
      3a1bfe87
    • Andrew Morton's avatar
      [PATCH] page freeing function for swsusp · 8ead40f5
      Andrew Morton authored
      Software suspend needs a way of forcing page reclaim, up to the point
      where 50% of memory is free.
      
      This patch implements a function to do that:
      
      	int shrink_all_memory(int nr_pages);
      
      Will attempt to reclaim `nr_pages' pages and return them to the free
      pages pool.  It returns the number of pages which it actually freed.
      
      If called with a "large" number of pages it will only free up to a few
      hundred, so the caller needs to loop on it.
      
      If it returns zero then there is no point in calling it again.
      8ead40f5
    • Andrew Morton's avatar
      [PATCH] direct-io bio_add_page fix · 5aa6ba1a
      Andrew Morton authored
      Patch from Badari Pulavarty
      
      There was a corner case in the conversion of direct-io to use
      bio_add_page() where we would start a new page out at the wrong sector
      number.
      
      Fix that by explicitly passing in the current page's starting sector,
      and use that in the new BIO if we have to open a new one.
      
      Fix an error-path page->count leak in dio_bio_add_page().
      5aa6ba1a
    • Andrew Morton's avatar
      [PATCH] /proc/meminfo alterations for hugetlbpages · 75a08275
      Andrew Morton authored
      The patch from Rohit and David M-T changes the hugetlb page info in
      /proc/meminfo slightly.
      
      It makes the identifiers a little clearer while ensuring that we don't
      add any identifiers which have whitespace.  glibc is/shall be parsing
      this information to determine the size and alignment requirements of
      the hugetlb pages.
      
      This basically means that procfs is a requirement for successful
      hugetlb page usage.  Not very nice, but I suspect real-world userspace
      fails without procfs anyway.
      75a08275
    • Andrew Morton's avatar
      [PATCH] n_r3964.c fix · 682134c5
      Andrew Morton authored
      - drivers/char/n_r3964.c does not compile.  r3964_open() is doing an
        INIT_LIST_HEAD() on a timer->list.  But timer's don't have a `list'
        any more.
      
        Do an init_timer() instead.
      682134c5
    • Andrew Morton's avatar
      [PATCH] scsi compile fix · a4561352
      Andrew Morton authored
      I'm getting a compile failure in scsi_syms.c because it doesn't know
      about the new scsi_set_medium_removal().
      a4561352
    • Linus Torvalds's avatar
      "tv_sec" is unsigned long. · a301c237
      Linus Torvalds authored
      a301c237
    • Matthew Dharm's avatar
      [PATCH] Fix SCSI mode sense size · cc75cd5e
      Matthew Dharm authored
      I'm suprised that this didn't cause errors for more people -- a
      MODE_SENSE request for 128 bytes with a stated buffer length of 24
      bytes.
      
      Fix: Make the buffer length match the size of the request.
      cc75cd5e
  2. 12 Oct, 2002 29 commits