1. 08 1月, 2009 1 次提交
  2. 07 1月, 2009 1 次提交
    • J
      sunrpc: add sv_maxconn field to svc_serv (try #3) · c9233eb7
      Jeff Layton 提交于
      svc_check_conn_limits() attempts to prevent denial of service attacks
      by having the service close old connections once it reaches a
      threshold. This threshold is based on the number of threads in the
      service:
      
      	(serv->sv_nrthreads + 3) * 20
      
      Once we reach this, we drop the oldest connections and a printk pops
      to warn the admin that they should increase the number of threads.
      
      Increasing the number of threads isn't an option however for services
      like lockd. We don't want to eliminate this check entirely for such
      services but we need some way to increase this limit.
      
      This patch adds a sv_maxconn field to the svc_serv struct. When it's
      set to 0, we use the current method to calculate the max number of
      connections. RPC services can then set this on an as-needed basis.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Acked-by: NNeil Brown <neilb@suse.de>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      c9233eb7
  3. 30 9月, 2008 1 次提交
  4. 19 5月, 2008 2 次提交
  5. 24 4月, 2008 2 次提交
    • J
      SUNRPC: allow svc_recv to break out of 500ms sleep when alloc_page fails · 7b54fe61
      Jeff Layton 提交于
      svc_recv() calls alloc_page(), and if it fails it does a 500ms
      uninterruptible sleep and then reattempts. There doesn't seem to be any
      real reason for this to be uninterruptible, so change it to an
      interruptible sleep. Also check for kthread_stop() and signalled() after
      setting the task state to avoid races that might lead to sleeping after
      kthread_stop() wakes up the task.
      
      I've done some very basic smoke testing with this, but obviously it's
      hard to test the actual changes since this all depends on an
      alloc_page() call failing.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      7b54fe61
    • J
      SUNRPC: have svc_recv() check kthread_should_stop() · 7086721f
      Jeff Layton 提交于
      When using kthreads that call into svc_recv, we want to make sure that
      they do not block there for a long time when we're trying to take down
      the kthread.
      
      This patch changes svc_recv() to check kthread_should_stop() at the same
      places that it checks to see if it's signalled(). Also check just before
      svc_recv() tries to schedule(). By making sure that we check it just
      after setting the task state we can avoid having to use any locking or
      signalling to ensure it doesn't block for a long time.
      
      There's still a chance of a 500ms sleep if alloc_page() fails, but
      that should be a rare occurrence and isn't a terribly long time in
      the context of a kthread being taken down.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      7086721f
  6. 18 3月, 2008 1 次提交
  7. 02 2月, 2008 17 次提交