diff options
author | André Fabian Silva Delgado | 2015-07-04 14:47:35 -0300 |
---|---|---|
committer | André Fabian Silva Delgado | 2015-07-04 14:49:31 -0300 |
commit | 2a917a601036720b174b5326fa260631d2971d52 (patch) | |
tree | 8f73e0a0c244ec4c1738a90a8b48e2491aa03c4c | |
parent | 11c81cdb01282af7024013d15fb466c892a302fe (diff) | |
download | aur-2a917a601036720b174b5326fa260631d2971d52.tar.gz |
Update to 4.0.7_gnu-2
* fix deadlock with stacked loop devices (FS#45129 -> https://bugs.archlinux.org/task/45129)
* fix bug #750 -> https://labs.parabola.nu/issues/750
-rw-r--r-- | .SRCINFO | 23 | ||||
-rw-r--r-- | 0001-block-loop-convert-to-per-device-workqueue.patch | 133 | ||||
-rw-r--r-- | 0002-block-loop-avoiding-too-many-pending-per-work-I-O.patch | 52 | ||||
-rw-r--r-- | PKGBUILD | 21 |
4 files changed, 212 insertions, 17 deletions
@@ -1,6 +1,6 @@ pkgbase = linux-libre - pkgver = 4.0.6_gnu - pkgrel = 1 + pkgver = 4.0.7_gnu + pkgrel = 2 url = http://linux-libre.fsfla.org/ arch = i686 arch = x86_64 @@ -14,8 +14,8 @@ pkgbase = linux-libre options = !strip source = http://linux-libre.fsfla.org/pub/linux-libre/releases/4.0-gnu/linux-libre-4.0-gnu.tar.xz source = http://linux-libre.fsfla.org/pub/linux-libre/releases/4.0-gnu/linux-libre-4.0-gnu.tar.xz.sign - source = http://linux-libre.fsfla.org/pub/linux-libre/releases/4.0.6-gnu/patch-4.0-gnu-4.0.6-gnu.xz - source = http://linux-libre.fsfla.org/pub/linux-libre/releases/4.0.6-gnu/patch-4.0-gnu-4.0.6-gnu.xz.sign + source = http://linux-libre.fsfla.org/pub/linux-libre/releases/4.0.7-gnu/patch-4.0-gnu-4.0.7-gnu.xz + source = http://linux-libre.fsfla.org/pub/linux-libre/releases/4.0.7-gnu/patch-4.0-gnu-4.0.7-gnu.xz.sign source = https://repo.parabola.nu/other/linux-libre/logos/logo_linux_clut224.ppm source = https://repo.parabola.nu/other/linux-libre/logos/logo_linux_clut224.ppm.sig source = https://repo.parabola.nu/other/linux-libre/logos/logo_linux_mono.pbm @@ -26,12 +26,14 @@ pkgbase = linux-libre source = config.x86_64 source = config.mips64el source = linux.preset + source = 0001-block-loop-convert-to-per-device-workqueue.patch + source = 0002-block-loop-avoiding-too-many-pending-per-work-I-O.patch source = change-default-console-loglevel.patch source = https://repo.parabola.nu/other/linux-libre/patches/4.0.2-ae91f13af5-loongson-community.patch source = https://repo.parabola.nu/other/linux-libre/patches/4.0.2-ae91f13af5-loongson-community.patch.sig sha256sums = 0e2dd5be12c1f82ab3d03b89cbe3f1a20e14332ec42c102efb226a6283fdd38a sha256sums = SKIP - sha256sums = 5cfcee748701771bb2ad46887c6b912fedfffe84bba42ad9e051be54f03a63c9 + sha256sums = c106ac1baa327ba39fc479c6b7b5c3a9f0a523ecc4db2a0be6a1f6f700d5cc53 sha256sums = SKIP sha256sums = bfd4a7f61febe63c880534dcb7c31c5b932dde6acf991810b41a939a93535494 sha256sums = SKIP @@ -43,6 +45,8 @@ pkgbase = linux-libre sha256sums = 33f68753bc12456e601492f870f7e04cd116f36b81630d9bad954093d72bc57a sha256sums = 7b6954ed843d17149129cc04064d00db791767ad8b7dca5a4833a2febafce50a sha256sums = f0d90e756f14533ee67afda280500511a62465b4f76adcc5effa95a40045179c + sha256sums = 0682df710e8d23f0d420b3b01fbfe409b3911940b1a379b78d9f4a5ac8590386 + sha256sums = af42b1456caee0b0db8f3cc770c78083b40159260b99db4930e503ac7824eacc sha256sums = 1256b241cd477b265a3c2d64bdc19ffe3c9bbcee82ea3994c590c2c76e767d99 sha256sums = 13e141279af2bc17decfc041e015710daac9a6cd1c9b4e871a76cb8f916b9e22 sha256sums = SKIP @@ -55,8 +59,7 @@ pkgname = linux-libre depends = kmod depends = mkinitcpio>=0.7 optdepends = crda: to set the correct wireless channels of your country - provides = linux=4.0.6 - conflicts = linux + provides = linux=4.0.7 conflicts = kernel26 conflicts = kernel26-libre conflicts = linux-libre-kmod-alx @@ -68,8 +71,7 @@ pkgname = linux-libre pkgname = linux-libre-headers pkgdesc = Header files and scripts for building modules for Linux-libre kernel - provides = linux-headers=4.0.6 - conflicts = linux-headers + provides = linux-headers=4.0.7 conflicts = kernel26-headers conflicts = kernel26-libre-headers replaces = linux-headers @@ -78,8 +80,7 @@ pkgname = linux-libre-headers pkgname = linux-libre-docs pkgdesc = Kernel hackers manual - HTML documentation that comes with the Linux-libre kernel - provides = linux-docs=4.0.6 - conflicts = linux-docs + provides = linux-docs=4.0.7 conflicts = kernel26-docs conflicts = kernel26-libre-docs replaces = linux-docs diff --git a/0001-block-loop-convert-to-per-device-workqueue.patch b/0001-block-loop-convert-to-per-device-workqueue.patch new file mode 100644 index 000000000000..3b426c7b4ac5 --- /dev/null +++ b/0001-block-loop-convert-to-per-device-workqueue.patch @@ -0,0 +1,133 @@ +From ebcacf05168d9791d39c5434164c64b9ef937171 Mon Sep 17 00:00:00 2001 +From: Ming Lei <ming.lei@canonical.com> +Date: Tue, 5 May 2015 19:49:54 +0800 +Subject: [PATCH 1/2] block: loop: convert to per-device workqueue + +Documentation/workqueue.txt: + If there is dependency among multiple work items used + during memory reclaim, they should be queued to separate + wq each with WQ_MEM_RECLAIM. + +Loop devices can be stacked, so we have to convert to per-device +workqueue. One example is Fedora live CD. + +Fixes: b5dd2f6047ca108001328aac0e8588edd15f1778 +Cc: stable@vger.kernel.org (v4.0) +Cc: Justin M. Forbes <jforbes@fedoraproject.org> +Signed-off-by: Ming Lei <ming.lei@canonical.com> +Acked-by: Tejun Heo <tj@kernel.org> +Signed-off-by: Jens Axboe <axboe@fb.com> +--- + drivers/block/loop.c | 30 ++++++++++++++---------------- + drivers/block/loop.h | 1 + + 2 files changed, 15 insertions(+), 16 deletions(-) + +diff --git a/drivers/block/loop.c b/drivers/block/loop.c +index d1f168b..fec06d5 100644 +--- a/drivers/block/loop.c ++++ b/drivers/block/loop.c +@@ -85,8 +85,6 @@ static DEFINE_MUTEX(loop_index_mutex); + static int max_part; + static int part_shift; + +-static struct workqueue_struct *loop_wq; +- + /* + * Transfer functions + */ +@@ -777,6 +775,12 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode, + size = get_loop_size(lo, file); + if ((loff_t)(sector_t)size != size) + goto out_putf; ++ error = -ENOMEM; ++ lo->wq = alloc_workqueue("kloopd%d", ++ WQ_MEM_RECLAIM | WQ_HIGHPRI | WQ_UNBOUND, 0, ++ lo->lo_number); ++ if (!lo->wq) ++ goto out_putf; + + error = 0; + +@@ -924,6 +928,8 @@ static int loop_clr_fd(struct loop_device *lo) + lo->lo_flags = 0; + if (!part_shift) + lo->lo_disk->flags |= GENHD_FL_NO_PART_SCAN; ++ destroy_workqueue(lo->wq); ++ lo->wq = NULL; + mutex_unlock(&lo->lo_ctl_mutex); + /* + * Need not hold lo_ctl_mutex to fput backing file. +@@ -1477,9 +1483,13 @@ static int loop_queue_rq(struct blk_mq_hw_ctx *hctx, + const struct blk_mq_queue_data *bd) + { + struct loop_cmd *cmd = blk_mq_rq_to_pdu(bd->rq); ++ struct loop_device *lo = cmd->rq->q->queuedata; + + blk_mq_start_request(bd->rq); + ++ if (lo->lo_state != Lo_bound) ++ return -EIO; ++ + if (cmd->rq->cmd_flags & REQ_WRITE) { + struct loop_device *lo = cmd->rq->q->queuedata; + bool need_sched = true; +@@ -1493,9 +1503,9 @@ static int loop_queue_rq(struct blk_mq_hw_ctx *hctx, + spin_unlock_irq(&lo->lo_lock); + + if (need_sched) +- queue_work(loop_wq, &lo->write_work); ++ queue_work(lo->wq, &lo->write_work); + } else { +- queue_work(loop_wq, &cmd->read_work); ++ queue_work(lo->wq, &cmd->read_work); + } + + return BLK_MQ_RQ_QUEUE_OK; +@@ -1507,9 +1517,6 @@ static void loop_handle_cmd(struct loop_cmd *cmd) + struct loop_device *lo = cmd->rq->q->queuedata; + int ret = -EIO; + +- if (lo->lo_state != Lo_bound) +- goto failed; +- + if (write && (lo->lo_flags & LO_FLAGS_READ_ONLY)) + goto failed; + +@@ -1858,13 +1865,6 @@ static int __init loop_init(void) + goto misc_out; + } + +- loop_wq = alloc_workqueue("kloopd", +- WQ_MEM_RECLAIM | WQ_HIGHPRI | WQ_UNBOUND, 0); +- if (!loop_wq) { +- err = -ENOMEM; +- goto misc_out; +- } +- + blk_register_region(MKDEV(LOOP_MAJOR, 0), range, + THIS_MODULE, loop_probe, NULL, NULL); + +@@ -1902,8 +1902,6 @@ static void __exit loop_exit(void) + blk_unregister_region(MKDEV(LOOP_MAJOR, 0), range); + unregister_blkdev(LOOP_MAJOR, "loop"); + +- destroy_workqueue(loop_wq); +- + misc_deregister(&loop_misc); + } + +diff --git a/drivers/block/loop.h b/drivers/block/loop.h +index 301c27f..49564ed 100644 +--- a/drivers/block/loop.h ++++ b/drivers/block/loop.h +@@ -54,6 +54,7 @@ struct loop_device { + gfp_t old_gfp_mask; + + spinlock_t lo_lock; ++ struct workqueue_struct *wq; + struct list_head write_cmd_head; + struct work_struct write_work; + bool write_started; +-- +2.4.5 + diff --git a/0002-block-loop-avoiding-too-many-pending-per-work-I-O.patch b/0002-block-loop-avoiding-too-many-pending-per-work-I-O.patch new file mode 100644 index 000000000000..c02a0b321641 --- /dev/null +++ b/0002-block-loop-avoiding-too-many-pending-per-work-I-O.patch @@ -0,0 +1,52 @@ +From 02a6b08b2706501fb0fe6ff2df2f7d8377f2f69b Mon Sep 17 00:00:00 2001 +From: Ming Lei <ming.lei@canonical.com> +Date: Tue, 5 May 2015 19:49:55 +0800 +Subject: [PATCH 2/2] block: loop: avoiding too many pending per work I/O + +If there are too many pending per work I/O, too many +high priority work thread can be generated so that +system performance can be effected. + +This patch limits the max_active parameter of workqueue as 16. + +This patch fixes Fedora 22 live booting performance +regression when it is booted from squashfs over dm +based on loop, and looks the following reasons are +related with the problem: + +- not like other filesyststems(such as ext4), squashfs +is a bit special, and I observed that increasing I/O jobs +to access file in squashfs only improve I/O performance a +little, but it can make big difference for ext4 + +- nested loop: both squashfs.img and ext3fs.img are mounted +as loop block, and ext3fs.img is inside the squashfs + +- during booting, lots of tasks may run concurrently + +Fixes: b5dd2f6047ca108001328aac0e8588edd15f1778 +Cc: stable@vger.kernel.org (v4.0) +Cc: Justin M. Forbes <jforbes@fedoraproject.org> +Signed-off-by: Ming Lei <ming.lei@canonical.com> +Acked-by: Tejun Heo <tj@kernel.org> +Signed-off-by: Jens Axboe <axboe@fb.com> +--- + drivers/block/loop.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/block/loop.c b/drivers/block/loop.c +index fec06d5..daaaf70 100644 +--- a/drivers/block/loop.c ++++ b/drivers/block/loop.c +@@ -777,7 +777,7 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode, + goto out_putf; + error = -ENOMEM; + lo->wq = alloc_workqueue("kloopd%d", +- WQ_MEM_RECLAIM | WQ_HIGHPRI | WQ_UNBOUND, 0, ++ WQ_MEM_RECLAIM | WQ_HIGHPRI | WQ_UNBOUND, 16, + lo->lo_number); + if (!lo->wq) + goto out_putf; +-- +2.4.5 + @@ -9,7 +9,7 @@ pkgbase=linux-libre # Build stock "" kernel _pkgbasever=4.0-gnu -_pkgver=4.0.6-gnu +_pkgver=4.0.7-gnu _replacesarchkernel=('linux%') # '%' gets replaced with _kernelname _replacesoldkernels=('kernel26%' 'kernel26-libre%') # '%' gets replaced with _kernelname @@ -18,7 +18,7 @@ _replacesoldmodules=('linux-libre%-kmod-alx') # '%' gets replaced with _kernelna _srcname=linux-${_pkgbasever%-*} _archpkgver=${_pkgver%-*} pkgver=${_pkgver//-/_} -pkgrel=1 +pkgrel=2 arch=('i686' 'x86_64' 'mips64el') url="http://linux-libre.fsfla.org/" license=('GPL2') @@ -38,13 +38,15 @@ source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${_pkgbasever}/li 'config.i686' 'config.x86_64' 'config.mips64el' # standard config files for mkinitcpio ramdisk 'linux.preset' + '0001-block-loop-convert-to-per-device-workqueue.patch' + '0002-block-loop-avoiding-too-many-pending-per-work-I-O.patch' 'change-default-console-loglevel.patch' # loongson-community patch: http://linux-libre.fsfla.org/pub/linux-libre/lemote/gnewsense/pool/debuginfo/ "https://repo.parabola.nu/other/linux-libre/patches/4.0.2-ae91f13af5-loongson-community.patch" "https://repo.parabola.nu/other/linux-libre/patches/4.0.2-ae91f13af5-loongson-community.patch.sig") sha256sums=('0e2dd5be12c1f82ab3d03b89cbe3f1a20e14332ec42c102efb226a6283fdd38a' 'SKIP' - '5cfcee748701771bb2ad46887c6b912fedfffe84bba42ad9e051be54f03a63c9' + 'c106ac1baa327ba39fc479c6b7b5c3a9f0a523ecc4db2a0be6a1f6f700d5cc53' 'SKIP' 'bfd4a7f61febe63c880534dcb7c31c5b932dde6acf991810b41a939a93535494' 'SKIP' @@ -56,6 +58,8 @@ sha256sums=('0e2dd5be12c1f82ab3d03b89cbe3f1a20e14332ec42c102efb226a6283fdd38a' '33f68753bc12456e601492f870f7e04cd116f36b81630d9bad954093d72bc57a' '7b6954ed843d17149129cc04064d00db791767ad8b7dca5a4833a2febafce50a' 'f0d90e756f14533ee67afda280500511a62465b4f76adcc5effa95a40045179c' + '0682df710e8d23f0d420b3b01fbfe409b3911940b1a379b78d9f4a5ac8590386' + 'af42b1456caee0b0db8f3cc770c78083b40159260b99db4930e503ac7824eacc' '1256b241cd477b265a3c2d64bdc19ffe3c9bbcee82ea3994c590c2c76e767d99' '13e141279af2bc17decfc041e015710daac9a6cd1c9b4e871a76cb8f916b9e22' 'SKIP') @@ -90,6 +94,11 @@ prepare() { # add latest fixes from stable queue, if needed # http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git + # Fix deadlock with stacked loop devices (FS#45129) + # http://marc.info/?l=linux-kernel&m=143280649731902&w=2 + patch -Np1 -i ../0001-block-loop-convert-to-per-device-workqueue.patch + patch -Np1 -i ../0002-block-loop-avoiding-too-many-pending-per-work-I-O.patch + # set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param) # remove this when a Kconfig knob is made available by upstream # (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227) @@ -135,7 +144,7 @@ _package() { depends=('coreutils' 'linux-libre-firmware' 'kmod' 'mkinitcpio>=0.7') optdepends=('crda: to set the correct wireless channels of your country') provides=("${_replacesarchkernel[@]/%/=${_archpkgver}}") - conflicts=("${_replacesarchkernel[@]}" "${_replacesoldkernels[@]}" "${_replacesoldmodules[@]}") + conflicts=("${_replacesoldkernels[@]}" "${_replacesoldmodules[@]}") replaces=("${_replacesarchkernel[@]}" "${_replacesoldkernels[@]}" "${_replacesoldmodules[@]}") backup=("etc/mkinitcpio.d/${pkgbase}.preset") install=linux.install @@ -192,7 +201,7 @@ _package() { _package-headers() { pkgdesc="Header files and scripts for building modules for ${pkgbase^} kernel" provides=("${_replacesarchkernel[@]/%/-headers=${_archpkgver}}") - conflicts=("${_replacesarchkernel[@]/%/-headers}" "${_replacesoldkernels[@]/%/-headers}") + conflicts=("${_replacesoldkernels[@]/%/-headers}") replaces=("${_replacesarchkernel[@]/%/-headers}" "${_replacesoldkernels[@]/%/-headers}") install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}" @@ -312,7 +321,7 @@ _package-headers() { _package-docs() { pkgdesc="Kernel hackers manual - HTML documentation that comes with the ${pkgbase^} kernel" provides=("${_replacesarchkernel[@]/%/-docs=${_archpkgver}}") - conflicts=("${_replacesarchkernel[@]/%/-docs}" "${_replacesoldkernels[@]/%/-docs}") + conflicts=("${_replacesoldkernels[@]/%/-docs}") replaces=("${_replacesarchkernel[@]/%/-docs}" "${_replacesoldkernels[@]/%/-docs}") cd "${srcdir}/${_srcname}" |