linux_dsm_epyc7002/drivers
Sergey Senozhatsky 6566d1a32b zram: add dynamic device add/remove functionality
We currently don't support on-demand device creation.  The one and only
way to have N zram devices is to specify num_devices module parameter
(default value: 1).  IOW if, for some reason, at some point, user wants
to have N + 1 devies he/she must umount all the existing devices, unload
the module, load the module passing num_devices equals to N + 1.  And do
this again, if needed.

This patch introduces zram control sysfs class, which has two sysfs
attrs:
- hot_add      -- add a new zram device
- hot_remove   -- remove a specific (device_id) zram device

hot_add sysfs attr is read-only and has only automatic device id
assignment mode (as requested by Minchan Kim).  read operation performed
on this attr creates a new zram device and returns back its device_id or
error status.

Usage example:
	# add a new specific zram device
	cat /sys/class/zram-control/hot_add
	2

	# remove a specific zram device
	echo 4 > /sys/class/zram-control/hot_remove

Returning zram_add() error code back to user (-ENOMEM in this case)

	cat /sys/class/zram-control/hot_add
	cat: /sys/class/zram-control/hot_add: Cannot allocate memory

NOTE, there might be users who already depend on the fact that at least
zram0 device gets always created by zram_init(). Preserve this behavior.

[minchan@kernel.org: use zram->claim to avoid lockdep splat]
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-06-25 17:00:36 -07:00
..
accessibility
acpi Power management and ACPI material for v4.2-rc1 2015-06-23 14:18:07 -07:00
amba
android
ata Merge branch 'for-4.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata 2015-06-08 08:47:08 -07:00
atm atm: idt77105: Use setup_timer 2015-06-10 22:46:34 -07:00
auxdisplay
base regmap: Fixes for v4.2 2015-06-23 17:25:32 -07:00
bcma bcma: lower dependency of BCMA_DRIVER_PCI_HOSTMODE 2015-06-08 14:33:26 +03:00
block zram: add dynamic device add/remove functionality 2015-06-25 17:00:36 -07:00
bluetooth Bluetooth: ath3k: Add support of 04ca:300d AR3012 device 2015-06-18 21:00:06 +03:00
bus Power management and ACPI material for v4.2-rc1 2015-06-23 14:18:07 -07:00
cdrom
char powerpc updates for 4.2 2015-06-24 08:46:32 -07:00
clk Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-06-24 16:49:49 -07:00
clocksource clocksource: Increase dependencies of timer-stm32 to limit build wreckage 2015-06-21 20:01:48 +02:00
connector
cpufreq Power management and ACPI material for v4.2-rc1 2015-06-23 14:18:07 -07:00
cpuidle Merge branch 'pm-cpuidle' 2015-06-22 15:15:36 +02:00
crypto Power management and ACPI material for v4.2-rc1 2015-06-23 14:18:07 -07:00
dca
devfreq
dio
dma Merge branch 'x86-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-06-22 17:59:09 -07:00
dma-buf
edac EDAC, mce_amd_inj: Set MISCV on injection 2015-06-24 18:17:38 +02:00
eisa
extcon
firewire
firmware Merge branch 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-06-22 17:10:44 -07:00
fmc
gpio Here is the bulk of pin control changes for the v4.2 series: 2015-06-24 19:21:02 -07:00
gpu Power management and ACPI material for v4.2-rc1 2015-06-23 14:18:07 -07:00
hid Merge branches 'for-4.2/i2c-hid', 'for-4.2/lenovo', 'for-4.2/plantronics', 'for-4.2/rmi', 'for-4.2/sensor-hub', 'for-4.2/sjoy', 'for-4.2/sony' and 'for-4.2/wacom' into for-linus 2015-06-22 16:23:43 +02:00
hsi HSI: nokia-modem: use flags argument of devm_gpiod_get to set direction 2015-06-23 02:40:03 +02:00
hv
hwmon hwmon changes for v4.2 2015-06-23 13:39:56 -07:00
hwspinlock
hwtracing/coresight
i2c == Changes to existing drivers == 2015-06-23 17:31:27 -07:00
ide
idle
iio
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-06-24 16:49:49 -07:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2015-06-24 19:56:58 -07:00
iommu IOMMU Updates for Linux v4.2 2015-06-23 18:27:19 -07:00
ipack
irqchip Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-06-22 19:42:56 -07:00
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-06-24 16:49:49 -07:00
leds Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2015-06-24 19:56:58 -07:00
lguest Merge branch 'x86-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-06-22 17:59:09 -07:00
macintosh macintosh/nvram: Remove as unused 2015-06-15 16:42:37 +10:00
mailbox
mcb
md md: make sure MD_RECOVERY_DONE is clear before starting recovery/resync 2015-06-12 20:16:33 +10:00
media Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2015-06-23 14:08:54 -07:00
memory
memstick
message fusion: remove dead MTRR code 2015-06-13 08:44:14 -07:00
mfd Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-06-24 16:49:49 -07:00
misc cxl: Fix typo in debug print 2015-06-19 17:10:30 +10:00
mmc mmc: queue: prevent soft lockups on PREEMPT=n 2015-06-18 09:21:04 +02:00
mtd powerpc updates for 4.2 2015-06-24 08:46:32 -07:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-06-24 16:49:49 -07:00
nfc NFC: nfcmrvl: set PB_BAIL_OUT at setup 2015-06-13 00:08:55 +02:00
ntb PCI changes for the v4.2 merge window: 2015-06-23 13:41:24 -07:00
nubus
of Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-06-24 16:49:49 -07:00
oprofile
parisc
parport
pci Power management and ACPI material for v4.2-rc1 2015-06-23 14:18:07 -07:00
pcmcia pcmcia: do not break rsrc_nonstatic when handling anonymous cards 2015-06-16 07:29:39 +02:00
phy
pinctrl Here is the bulk of pin control changes for the v4.2 series: 2015-06-24 19:21:02 -07:00
platform == Changes to existing drivers == 2015-06-23 17:31:27 -07:00
pnp Merge branches 'pnp' and 'pm-tools' 2015-06-19 01:18:43 +02:00
power power supply and reset changes for the v4.2 series 2015-06-23 16:10:27 -07:00
powercap
pps
ps3
ptp
pwm pwm: Changes for v4.2-rc1 2015-06-23 13:32:38 -07:00
rapidio Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2015-06-23 14:08:54 -07:00
ras
regulator == Changes to existing drivers == 2015-06-23 17:31:27 -07:00
remoteproc
reset
rpmsg
rtc == Changes to existing drivers == 2015-06-23 17:31:27 -07:00
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-06-24 16:49:49 -07:00
sbus
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-06-24 16:49:49 -07:00
sfi
sh
sn
soc
spi Merge remote-tracking branches 'spi/topic/sirf', 'spi/topic/spidev' and 'spi/topic/zynq' into spi-next 2015-06-18 00:19:56 +01:00
spmi
ssb SSB: Fix handling of ssb_pmu_get_alp_clock() 2015-06-09 16:38:06 +02:00
staging Merge branch 'akpm' (patches from Andrew) 2015-06-24 20:47:21 -07:00
target Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-06-24 16:49:49 -07:00
tc
thermal
thunderbolt
tty Merge branch 'akpm' (patches from Andrew) 2015-06-24 20:47:21 -07:00
uio
usb SCSI misc on 20150622 2015-06-23 15:55:44 -07:00
uwb
vfio powerpc updates for 4.2 2015-06-24 08:46:32 -07:00
vhost Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-06-24 16:49:49 -07:00
video == Changes to existing drivers == 2015-06-24 18:57:00 -07:00
virt
virtio PCI changes for the v4.2 merge window: 2015-06-23 13:41:24 -07:00
vlynq
vme
w1
watchdog
xen frontswap: allow multiple backends 2015-06-24 17:49:45 -07:00
zorro
Kconfig
Makefile