#
# User resources part (UBC)
#
# Copyright (C) 2005  SWsoft
# All rights reserved.
#
# Licensing governed by "linux/COPYING.SWsoft" file.

menu "User resources"

config USER_RESOURCE
	bool "Enable user resource accounting"
	default y
	help 
          This patch provides accounting and allows to configure
          limits for user's consumption of exhaustible system resources.
          The most important resource controlled by this patch is unswappable 
          memory (either mlock'ed or used by internal kernel structures and 
          buffers). The main goal of this patch is to protect processes
          from running short of important resources because of an accidental
          misbehavior of processes or malicious activity aiming to ``kill'' 
          the system. It's worth to mention that resource limits configured 
          by setrlimit(2) do not give an acceptable level of protection 
          because they cover only small fraction of resources and work on a 
          per-process basis.  Per-process accounting doesn't prevent malicious
          users from spawning a lot of resource-consuming processes.

config USER_RSS_ACCOUNTING
	bool "Account physical memory usage"
	default y
	depends on USER_RESOURCE
	help
          This allows to estimate per beancounter physical memory usage.
          Implemented alghorithm accounts shared pages of memory as well,
          dividing them by number of beancounter which use the page.

config UBC_IO_ACCT
	bool "Account disk IO"
	default y
	depends on USER_RSS_ACCOUNTING
	help
	  When on this option allows seeing disk IO activity caused by
	  tasks from each UB

config USER_SWAP_ACCOUNTING
	bool "Account swap usage"
	default y
	depends on USER_RESOURCE
	help
          This allows accounting of swap usage.

config USER_RESOURCE_PROC
	bool "Report resource usage in /proc"
	default y
	depends on USER_RESOURCE
	help
          Allows a system administrator to inspect resource accounts and limits.

config UBC_DEBUG
	bool "User resources debug features"
	default n
	depends on USER_RESOURCE
	help
	  Enables to setup debug features for user resource accounting

config UBC_DEBUG_IO
	bool "Debug IO accounting"
	default y
	depends on UBC_DEBUG && UBC_IO_ACCT
	help
	  Debugging for IO accointing.

config UBC_DEBUG_KMEM
	bool "Debug kmemsize with cache counters"
	default n
	depends on UBC_DEBUG
	help
	  Adds /proc/user_beancounters_debug entry to get statistics
	  about cache usage of each beancounter

config UBC_KEEP_UNUSED
	bool "Keep unused beancounter alive"
	default y
	depends on UBC_DEBUG
	help
	  If on, unused beancounters are kept on the hash and maxheld value
	  can be looked through.

config UBC_DEBUG_ITEMS
	bool "Account resources in items rather than in bytes"
	default y
	depends on UBC_DEBUG
	help
	  When true some of the resources (e.g. kmemsize) are accounted
	  in items instead of bytes.

config UBC_UNLIMITED
	bool "Use unlimited ubc settings"
	default y
	depends on UBC_DEBUG
	help
	  When ON all limits and barriers are set to max values.

config UBC_IO_PRIO
	bool "UBC I/O priority"
	default y
	depends on UBC_IO_ACCT && IOSCHED_CFQ
	help
	  This option controls whether to build CFQ I/O scheduler
	  with support of UBC I/O priority.
endmenu
