diff options
author | Richard Yao <ryao@gentoo.org> | 2013-01-14 21:08:01 +0000 |
---|---|---|
committer | Richard Yao <ryao@gentoo.org> | 2013-01-14 21:08:01 +0000 |
commit | 34e15741939511d0e85c095f1a44539a0cb3aa54 (patch) | |
tree | 2e35b67445ae1cd0faacdeccfa0dfe96ca1cf158 /sys-kernel/spl | |
parent | Add 13.0 release directory referring to eapi-5-files (diff) | |
download | historical-34e15741939511d0e85c095f1a44539a0cb3aa54.tar.gz historical-34e15741939511d0e85c095f1a44539a0cb3aa54.tar.bz2 historical-34e15741939511d0e85c095f1a44539a0cb3aa54.zip |
Fix autotools issue detected on ~arm, fix soft lockup regression, add Linux 3.8 support
Package-Manager: portage-2.1.11.31/cvs/Linux x86_64
Diffstat (limited to 'sys-kernel/spl')
-rw-r--r-- | sys-kernel/spl/ChangeLog | 13 | ||||
-rw-r--r-- | sys-kernel/spl/Manifest | 7 | ||||
-rw-r--r-- | sys-kernel/spl/files/spl-0.6.0_rc13-fix-on_each_cpu-autotools-check.patch | 46 | ||||
-rw-r--r-- | sys-kernel/spl/files/spl-0.6.0_rc13-fix-soft-lockup.patch | 179 | ||||
-rw-r--r-- | sys-kernel/spl/spl-0.6.0_rc11-r2.ebuild | 13 | ||||
-rw-r--r-- | sys-kernel/spl/spl-0.6.0_rc13-r1.ebuild | 99 |
6 files changed, 348 insertions, 9 deletions
diff --git a/sys-kernel/spl/ChangeLog b/sys-kernel/spl/ChangeLog index d350cf28fc32..0ab0bcd74306 100644 --- a/sys-kernel/spl/ChangeLog +++ b/sys-kernel/spl/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for sys-kernel/spl -# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/spl/ChangeLog,v 1.37 2012/12/29 17:01:12 ryao Exp $ +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/spl/ChangeLog,v 1.38 2013/01/14 21:07:59 ryao Exp $ + +*spl-0.6.0_rc13-r1 (14 Jan 2013) + + 14 Jan 2013; Richard Yao <ryao@gentoo.org> + +files/spl-0.6.0_rc13-fix-on_each_cpu-autotools-check.patch, + +files/spl-0.6.0_rc13-fix-soft-lockup.patch, +spl-0.6.0_rc13-r1.ebuild, + spl-0.6.0_rc11-r2.ebuild: + Fix autotools issue detected on ~arm, fix soft lockup regression, add Linux + 3.8 support 29 Dec 2012; Richard Yao <ryao@gentoo.org> spl-0.6.0_rc10.ebuild, spl-0.6.0_rc11-r2.ebuild, spl-0.6.0_rc11.ebuild, spl-0.6.0_rc12-r1.ebuild, diff --git a/sys-kernel/spl/Manifest b/sys-kernel/spl/Manifest index 85249dcff957..5469dbb18bf1 100644 --- a/sys-kernel/spl/Manifest +++ b/sys-kernel/spl/Manifest @@ -2,17 +2,20 @@ AUX spl-0.6.0_rc11-linux-3.6-compat.patch 7545 SHA256 babec54aa933e2bf3b068f50a2 AUX spl-0.6.0_rc12-fix-3.6-compat-regression.patch 1005 SHA256 6c245b2477532fa215da104813157be6c0aefbd7f31f008a8b7f8107b8f8a49f SHA512 7a14a020fc7320edb7c2486bf1fa2fbf79a0445083c711e2c7f2dadd77d784bccda299bc647e99a6dc19b9d51b5b01bf11d7365337904215f5c7f0fefbbf7028 WHIRLPOOL cfa5847876458f979f2d162ec8d4cc04acf5a92f1b3ddc3b0b74342ee947b770851296698fbf345813664454c24cc388a8724b208013c0532a7b8022f6e63f51 AUX spl-0.6.0_rc12-fix-race-in-slabs.patch 1822 SHA256 6375b164125e1a7a8e022b09405eb3cef911f5ce40840d8ddfde39fcd21c79a7 SHA512 2401082aab5747d957b49f17ab08cbc0565597eacf48a58def0cb8043903c929a5d6cbde09ac833e1ff56fef291e50fe50e3e41b2b5719a392fe5ff382e298b4 WHIRLPOOL 985986edb62dbec2a7ae4ac7338d31a1c02c175fa2b550506785207ccbddf32410b9b79eb878ca395ff77b030b6a8db532440521637e3dfb4ba33f189df5c1ea AUX spl-0.6.0_rc12-linux-3.7-compat.patch 12915 SHA256 f28d19df37718def641649b90ace5a00063bd9789e999cfcf696fe6374492123 SHA512 9352eb2bc7733dd029cf5ecd17c0e1a981ca65e839fffc367c9f6e786c0a374f797a70e6439d026999b31e824de0b97eab7ef5fb324c626964758d48eb5549a2 WHIRLPOOL 2af6b22e0ab0960cd923403f96ec7752a10c19efbf611b2c24f72d75b302aa6de4c1ee32f2af44a03e65fb17baab92574a4b667b13746538c7cdd2dc2540c48c +AUX spl-0.6.0_rc13-fix-on_each_cpu-autotools-check.patch 1508 SHA256 1ef61882e689ed1182b0e77a3b27ba108f18fccff7311462d9c8aef29dfa9056 SHA512 b9bf99b52f3135cb5ae017409ad773e7741536ed6c7181cccb8d97aa627a000417b24971818894dbfa0158a81f4a1be7a9627896b69d4f13988a99f1a39c0bfe WHIRLPOOL 9356a518a1d4a661c4a706347d00b2ec2873198fab379d5a644dde0fc4749f43a9ee542bcf65884de25b97a0e75668a2bd741ce4878ac80c398346eef4b55884 +AUX spl-0.6.0_rc13-fix-soft-lockup.patch 6154 SHA256 85173dcdd261f6aebee9e04098201c58164a74ba01d4a8775d6fb3c7c197c69c SHA512 bbc4d30be0f4425cc1f6076f1ed8d572a8255052f194ad47bde7a9b837689786dcf131326d50f8d4e23d8f0bbf79ce438c273fa33f7c98cdf0bb94c4673c4a0d WHIRLPOOL c4a7efb0858a92da466a69db14f4559188a7f731da7eeaf4f17470a17acb60d81da41c22b6801116d23eb71e4c449097f2ce2af386fd6c3aa915ef7718f49dae AUX spl-0.6.0_rc9-alias-km-sleep-with-km-pushpage.patch 2071 SHA256 d34d56201046c6464141c50c815a956e200260c4b17a057af2dde6fdb5fcf949 SHA512 8decd4a803b85b46b5c241eeb0dd7b44e0491a972b08094d763a20d5ef21624ff0bbe79e56098600702f78f506e842c8bbfc3bc94067b86531399b0ba0b4285e WHIRLPOOL 5fbe166099b10e1281e5d824e25acd7f4467766d865e6c297dd8b503906b12bc63221babb0fb6e9fade65679a8637489cec16ac3e6e14d54457c9cda858db9db DIST spl-0.6.0-rc10.tar.gz 523189 SHA256 b25a748b18522f38b495f3577905ccd296f2782d1180140a05bd1efa19113ea0 SHA512 c5a01c9d42afcc3c4069b771fed2cbdc20d621994d2709a06057d93aeecc1b15c442cf5bce4cced90ecf7ac841f610e0b55b678e2bde8b853aeefac4402baf19 WHIRLPOOL 961edac42c35b1ecf65748eb2fc9876ed8cf1207307eedaba41a381e519589859ad5bbe468f7b94d563ec954e10c47237b4540f63a7ea211bbf9d92158f06b11 DIST spl-0.6.0-rc11.tar.gz 521190 SHA256 0f39edfb87c444781080e6f60acbd1094e3113cfc85a23d4e997fe0d53ce3a2f SHA512 d85dd2b10f98028ebc77069e63fd54241d7e8290cf81856cfb82648279e736ce108bc02b21993a87b8e8a046c3a3f37c0a3ede4cd32a4fa6be032316b47c5add WHIRLPOOL d49b863321173fa8effdaa338df4b8171e8db54f11b5f789a618ffa6abbdfcba721d2d38c59bac77786fb2d64096ed1e8f65a42f7ad2ab37a581d5e2493c05cb DIST spl-0.6.0-rc12.tar.gz 546842 SHA256 5352ecfa3bed7807bf4b154121c7f6349d986fea44125bd171240985ef28c898 SHA512 d71db7cc6e8ddec13f90a089a60d9b024f16576ed47b5458b88b7a8efad833b95219d9802c57edf76bfa77e65fd523e31aa768a37f8cd4036c828e7e4cf0534d WHIRLPOOL c6adccbcb9e7c30bead63b94168fc6348cd25ce3348e9e8191797b4100481fb727633760692c8aebb263062b393ae843aeb97718d106ac611e6664d1c5d475b3 DIST spl-0.6.0-rc13.tar.gz 210192 SHA256 500d9c9297f2b7abdc4fce43efe05dddda2edbe403f9ca76d01ae632f798ee1f SHA512 630b63c15e98ada397bc8b8a1a5b6a48255ffa5d7fad8dd0ed9ad7fbede32f3557651effcc99234ffef1a1b9bb13e289c0ca5a2cf60307e0a57ac3a93b709f6b WHIRLPOOL 9330dd1567421e610a714b69d096bbae66c102baaf90fa3daed45cc1a2928eb3dd0e8537f3cf83a7fb2b157bf52ff37b031bcf6c9f52760acd6e480ad335b69a EBUILD spl-0.6.0_rc10.ebuild 2196 SHA256 d759f18c10b231cadd3e906e4ddc7fc4169b7b12bc058e52a48f32a6dabf16c3 SHA512 dd43e952a9a2aa6179fd953c554f1c1e0b6ec49d63659168f9780451b4b46916db9577914f65341a6f5ef13acaeaabd13524453e3fa328de647438d9dcf8ffc2 WHIRLPOOL 0927b113384d7e20b3d566bc3a8d5e0e35360b1637238ac3f83fb6d023316d7c3fdace4d72b828dacc17acdde9745d869a4a10f94a0b433ea3fd300254a8a438 -EBUILD spl-0.6.0_rc11-r2.ebuild 2278 SHA256 c0fe3148c9cca90e306529e523b04bedd9019d60eec12890e9fb248011639a98 SHA512 d01a466796a3e65ec3baaf657ec1c21ec394ef4b169bc9494a19dd1d2be1ae259a9675a437a1dc66a1c3484113beb84d6ac456712a27c666f7c920162bc3037d WHIRLPOOL 31d4ae8dd928855437de2267f38b49917dc13060ef83b2d71a85cc5ab71de14e80d314db885ec5d04fb035c644761f9783c2e407bef2b624dd51128384aa329e +EBUILD spl-0.6.0_rc11-r2.ebuild 2315 SHA256 eb4398bc535f0136b10d2364323c6233941cb19306620f31b1ab3e150bc327f5 SHA512 49110722c85bd6929b107436a36824cce747a968d62aa85f3cef9eedd19bacaa0cc89df732ebb79fe15f041d642a4fe3a8f3fcf80a930ea5e3f8de01c127f7e3 WHIRLPOOL 869c9e189103ada5ce94c9a7acf9257b40f48d6af71b4dbabeed78956e8b7fc2243d91f5d8741628e180b62e87b224ca54a7e56edea626937b30c3dae79c7b0c EBUILD spl-0.6.0_rc11.ebuild 2132 SHA256 ede528485719992eed75be4f985b0845cdf5cf92695eb6746505c413fdec0df6 SHA512 625b856b006195162a949850d17c5604b5ce42ce10755f637fbb07dc2a4fe34599b0e3abb02383c2a697e8eb4317b743937fe9feaff22937c08a274408111325 WHIRLPOOL 581e096921fce5dc931278c9da4ce5479a7260b0b74fafc9e0bb5d1f5246d66adbafd999ef601f967a2aa5d5ed7b3f991a3b0d35a813c850ea42187fa566f7f5 EBUILD spl-0.6.0_rc12-r1.ebuild 2331 SHA256 41b0aa3fbb5283b509fc17d4153bc02463365b7388cca21d03506e19c2948719 SHA512 afd25d8c892ef7b6b415706a402047bdd9a78f9b8da148aa9f7700643134fca01710b5f2385cd0299f99e4913c768a8b275fb299f8bac5d622406329ba6ea954 WHIRLPOOL 55d81dd92eaaf4fc9a26d3320a8faee15ff0ec97a4db040680117699674823d8baf5363de3ca644f36391ac3101e842a589dd7396f3ac16869d49660bdfcad86 EBUILD spl-0.6.0_rc12.ebuild 2106 SHA256 8be696d93fc2016766e9d8b1ea25a268b4f8e9a1a23b3cf3224458341f1f24e7 SHA512 a2f1676ab1c6e76e1d91c698f3f90f956a18ee042a8407b3241c79e61b89b5c82a01812d44b2ee4bb2b6052d3c808e5a53db1e12481eb60fac1e049aa67073f3 WHIRLPOOL fb3cd18272c1efef67e0ed99fb0dccd617e3cd714fb739dba08c26c75409718fa7fb346a858cb69f7428ea7f3d1f4202729be55359e9d330282a381522f80c3d +EBUILD spl-0.6.0_rc13-r1.ebuild 2346 SHA256 281e7d9b8d83d6548ba967d094f92dad001643429fa6c0dff7e83c8ceaa3f568 SHA512 31b5b9a41b841a9a5215aead0e5346b1cf6c51192e2a553165e07bc751c994c5350cf81d08143c24529dfba971e4c0c3d930020859610ae8742bfa55485f26c2 WHIRLPOOL a2720dbf82512da25113c0c303842a1520f32e7af1fafd55105a43f5e1f2b764f86ade44461bf31da1c0c21f8dfefddfddd2f441c82ca405d43ee898fa41d179 EBUILD spl-0.6.0_rc13.ebuild 2110 SHA256 21a365c7064d25c9a2a04d13ef90002b2f302f1e696a836eb0fe753cff143f9b SHA512 ca7f87521c6f7b74b70f048f3b2bc5b16e16b94006f6c020d59c6667548c79f3efc8d35f069e3a55a6b4e9fddd227d1a0951a6472392be46421e75ea6a42ce9f WHIRLPOOL 5780f7d13a2e90bd0442a330e39ab3d06887fa9e48d5baf85aff9a8434e75d2ad7ef8ab9950457a00f212c86ad51e79ba3efe87056dbfff0f65538d155f9ad71 EBUILD spl-9999.ebuild 2065 SHA256 9f1fda711e89160ddf4d53a914f13a014e02088dfa5adabb25de3cf97408cdf3 SHA512 ae2d941dae857a092154304bbb78ff9222ff6e2b88027021820322498020cf87189ab53b017431ec17d78ab060726a51bc80f8e577cbf272844ad53961d7f50c WHIRLPOOL 3749fab0f09b9e7fba69d1345de20c47fcc293749c7c44ea15e912ec9514c1c49713d3461a3dabb7601b3c16f43d41328691c66b17ada7aa0490fdf9a1042dd5 -MISC ChangeLog 6322 SHA256 6e13faaea0bcbd0f7f281fe13f3952d9f31b6fa14e5a30515a77a30051a76de9 SHA512 73178c086791f6f5316c931f1b78dfa38498e0c0f3cf13caed3fc67c82a44119a46b7b145fc54ea2e0facb653f93eb6393edb197fec0167f5392a42e9508fbec WHIRLPOOL 9c1bf1dc6c61dd6dd6659b1beecc6c3b252f3de9be32f62bfb38c631e2fc0886b369784759101a5295cfd792dda1ed870248d81c9ad177b41ae1fcdbd5757a5a +MISC ChangeLog 6659 SHA256 a8b8127366028b5d2d3c175d47943d4c6204533c1f91798d5b77ff0695502030 SHA512 cf5e647c8bc25fb25b772d1bc08d9be91a4dcd92c8c5fa5684b46271f875586e6e7f15099625a196768b1631cfb5b1a8a2a7afe4e5f2ab991ad1f331b399165e WHIRLPOOL 4a1dd74fa0a5fdeb688702b11e75ce753363331cb9bcee6910936852d501aac6513071a5aee501eaa25d30091bc6afaf13781e1c3bb700d5ff2e895e7d429cef MISC metadata.xml 305 SHA256 1379ed630ee72009790f82073e4777a26ca612e0c023825f4a2648266422672e SHA512 ec56bad42e58b3979698fe6607ca1854b018d2292f02f79f6cda070cfe1489b31d9738cfe886597edaca36dbe839a8d909c78f8e4c47b1764b1a0d586df75d33 WHIRLPOOL 11016324ed29ddb27d0c67488e24d15d8d34881a20d21d2807accad014feb4e5b29ceb8d72134f7d8c58d5f83b91c157290c51ea883a5f8007499e73d02acbcd diff --git a/sys-kernel/spl/files/spl-0.6.0_rc13-fix-on_each_cpu-autotools-check.patch b/sys-kernel/spl/files/spl-0.6.0_rc13-fix-on_each_cpu-autotools-check.patch new file mode 100644 index 000000000000..e8eaa385c642 --- /dev/null +++ b/sys-kernel/spl/files/spl-0.6.0_rc13-fix-on_each_cpu-autotools-check.patch @@ -0,0 +1,46 @@ +From 050cd84e628e5d827a0b345cda12b97253fccd37 Mon Sep 17 00:00:00 2001 +From: Brian Behlendorf <behlendorf1@llnl.gov> +Date: Mon, 7 Jan 2013 14:09:09 -0800 +Subject: [PATCH] Linux compat 3.7.1, on_each_cpu() + +Some kernels require that we include the 'linux/irqflags.h' +header for the SPL_AC_3ARGS_ON_EACH_CPU check. Otherwise, +the functions local_irq_enable()/local_irq_disable() will not +be defined and the prototype will be misdetected as the four +argument version. + +This change actually include 'linux/interrupt.h' which in turn +includes 'linux/irqflags.h' to be as generic as possible. + +Additionally, passing NULL as the function can result in a +gcc error because the on_each_cpu() macro executes it +unconditionally. To make the test more robust we pass the +dummy function on_each_cpu_func(). + +Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> +Closes #204 +--- + config/spl-build.m4 | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/config/spl-build.m4 b/config/spl-build.m4 +index f710d8e..6e4afed 100644 +--- a/config/spl-build.m4 ++++ b/config/spl-build.m4 +@@ -1312,9 +1312,12 @@ dnl # + AC_DEFUN([SPL_AC_3ARGS_ON_EACH_CPU], [ + AC_MSG_CHECKING([whether on_each_cpu() wants 3 args]) + SPL_LINUX_TRY_COMPILE([ ++ #include <linux/interrupt.h> + #include <linux/smp.h> ++ ++ void on_each_cpu_func(void *data) { return; } + ],[ +- on_each_cpu(NULL, NULL, 0); ++ on_each_cpu(on_each_cpu_func, NULL, 0); + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_3ARGS_ON_EACH_CPU, 1, +-- +1.7.10 + diff --git a/sys-kernel/spl/files/spl-0.6.0_rc13-fix-soft-lockup.patch b/sys-kernel/spl/files/spl-0.6.0_rc13-fix-soft-lockup.patch new file mode 100644 index 000000000000..99227feb04a2 --- /dev/null +++ b/sys-kernel/spl/files/spl-0.6.0_rc13-fix-soft-lockup.patch @@ -0,0 +1,179 @@ +From d4899f4747fd03be748fd1a589b9db5786fa1375 Mon Sep 17 00:00:00 2001 +From: Brian Behlendorf <behlendorf1@llnl.gov> +Date: Fri, 11 Jan 2013 14:29:32 -0800 +Subject: [PATCH] kmem-cache: Fix slab ageing soft lockup + +Commit a10287e00d13c4c4dbbff14f42b00b03da363fcb slightly reworked +the slab ageing code such that it is no longer dependent on the +Linux delayed work queue interfaces. + +This was good for portability and performance, but it requires us +to use the on_each_cpu() function to execute the spl_magazine_age() +function. That means that the function is now executing in interrupt +context whereas before it was scheduled in normal process context. +And that means we need to be slightly more careful about the locking +in the interrupt handler. + +With the reworked code it's possible that we'll be holding the +skc->skc_lock and be interrupted to handle the spl_magazine_age() +IRQ. This will result in a deadlock and soft lockup errors unless +we're careful to detect the contention and avoid taking the lock in +the interupt handler. So that's what this patch does. + +Alternately, (and slightly more conventionally) we could have used +spin_lock_irqsave() to prevent this race entirely but I'd perfer to +avoid disabling interrupts as much as possible due to performance +concerns. There is absolutely no penalty for us not aging objects +out of the magazine due to contention. + +Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> +Signed-off-by: Prakash Surya <surya1@llnl.gov> +Closes zfsonlinux/zfs#1193 +--- + module/spl/spl-kmem.c | 94 +++++++++++++++++++++++++++---------------------- + 1 file changed, 51 insertions(+), 43 deletions(-) + +diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c +index bc08a55..cc5961e 100644 +--- a/module/spl/spl-kmem.c ++++ b/module/spl/spl-kmem.c +@@ -827,8 +827,7 @@ char *kvasprintf(gfp_t gfp, const char *fmt, va_list ap) + struct rw_semaphore spl_kmem_cache_sem; /* Cache list lock */ + taskq_t *spl_kmem_cache_taskq; /* Task queue for ageing / reclaim */ + +-static int spl_cache_flush(spl_kmem_cache_t *skc, +- spl_kmem_magazine_t *skm, int flush); ++static void spl_cache_shrink(spl_kmem_cache_t *skc, void *obj); + + SPL_SHRINKER_CALLBACK_FWD_DECLARE(spl_kmem_cache_generic_shrinker); + SPL_SHRINKER_DECLARE(spl_kmem_cache_shrinker, +@@ -1244,6 +1243,38 @@ static int spl_cache_flush(spl_kmem_cache_t *skc, + SRETURN(0); + } + ++/* ++ * Release objects from the per-cpu magazine back to their slab. The flush ++ * argument contains the max number of entries to remove from the magazine. ++ */ ++static void ++__spl_cache_flush(spl_kmem_cache_t *skc, spl_kmem_magazine_t *skm, int flush) ++{ ++ int i, count = MIN(flush, skm->skm_avail); ++ SENTRY; ++ ++ ASSERT(skc->skc_magic == SKC_MAGIC); ++ ASSERT(skm->skm_magic == SKM_MAGIC); ++ ASSERT(spin_is_locked(&skc->skc_lock)); ++ ++ for (i = 0; i < count; i++) ++ spl_cache_shrink(skc, skm->skm_objs[i]); ++ ++ skm->skm_avail -= count; ++ memmove(skm->skm_objs, &(skm->skm_objs[count]), ++ sizeof(void *) * skm->skm_avail); ++ ++ SEXIT; ++} ++ ++static void ++spl_cache_flush(spl_kmem_cache_t *skc, spl_kmem_magazine_t *skm, int flush) ++{ ++ spin_lock(&skc->skc_lock); ++ __spl_cache_flush(skc, skm, flush); ++ spin_unlock(&skc->skc_lock); ++} ++ + static void + spl_magazine_age(void *data) + { +@@ -1252,10 +1283,23 @@ static int spl_cache_flush(spl_kmem_cache_t *skc, + + ASSERT(skm->skm_magic == SKM_MAGIC); + ASSERT(skm->skm_cpu == smp_processor_id()); ++ ASSERT(irqs_disabled()); ++ ++ /* There are no available objects or they are too young to age out */ ++ if ((skm->skm_avail == 0) || ++ time_before(jiffies, skm->skm_age + skc->skc_delay * HZ)) ++ return; + +- if (skm->skm_avail > 0) +- if (time_after(jiffies, skm->skm_age + skc->skc_delay * HZ)) +- (void) spl_cache_flush(skc, skm, skm->skm_refill); ++ /* ++ * Because we're executing in interrupt context we may have ++ * interrupted the holder of this lock. To avoid a potential ++ * deadlock return if the lock is contended. ++ */ ++ if (!spin_trylock(&skc->skc_lock)) ++ return; ++ ++ __spl_cache_flush(skc, skm, skm->skm_refill); ++ spin_unlock(&skc->skc_lock); + } + + /* +@@ -1451,7 +1495,7 @@ static int spl_cache_flush(spl_kmem_cache_t *skc, + + for_each_online_cpu(i) { + skm = skc->skc_mag[i]; +- (void)spl_cache_flush(skc, skm, skm->skm_avail); ++ spl_cache_flush(skc, skm, skm->skm_avail); + spl_magazine_free(skm); + } + +@@ -1932,42 +1976,6 @@ static int spl_cache_flush(spl_kmem_cache_t *skc, + } + + /* +- * Release a batch of objects from a per-cpu magazine back to their +- * respective slabs. This occurs when we exceed the magazine size, +- * are under memory pressure, when the cache is idle, or during +- * cache cleanup. The flush argument contains the number of entries +- * to remove from the magazine. +- */ +-static int +-spl_cache_flush(spl_kmem_cache_t *skc, spl_kmem_magazine_t *skm, int flush) +-{ +- int i, count = MIN(flush, skm->skm_avail); +- SENTRY; +- +- ASSERT(skc->skc_magic == SKC_MAGIC); +- ASSERT(skm->skm_magic == SKM_MAGIC); +- +- /* +- * XXX: Currently we simply return objects from the magazine to +- * the slabs in fifo order. The ideal thing to do from a memory +- * fragmentation standpoint is to cheaply determine the set of +- * objects in the magazine which will result in the largest +- * number of free slabs if released from the magazine. +- */ +- spin_lock(&skc->skc_lock); +- for (i = 0; i < count; i++) +- spl_cache_shrink(skc, skm->skm_objs[i]); +- +- skm->skm_avail -= count; +- memmove(skm->skm_objs, &(skm->skm_objs[count]), +- sizeof(void *) * skm->skm_avail); +- +- spin_unlock(&skc->skc_lock); +- +- SRETURN(count); +-} +- +-/* + * Allocate an object from the per-cpu magazine, or if the magazine + * is empty directly allocate from a slab and repopulate the magazine. + */ +@@ -2053,7 +2061,7 @@ static int spl_cache_flush(spl_kmem_cache_t *skc, + + /* Per-CPU cache full, flush it to make space */ + if (unlikely(skm->skm_avail >= skm->skm_size)) +- (void)spl_cache_flush(skc, skm, skm->skm_refill); ++ spl_cache_flush(skc, skm, skm->skm_refill); + + /* Available space in cache, use it */ + skm->skm_objs[skm->skm_avail++] = obj; +-- +1.7.10 + diff --git a/sys-kernel/spl/spl-0.6.0_rc11-r2.ebuild b/sys-kernel/spl/spl-0.6.0_rc11-r2.ebuild index 08149c706ee0..9d5bfe751060 100644 --- a/sys-kernel/spl/spl-0.6.0_rc11-r2.ebuild +++ b/sys-kernel/spl/spl-0.6.0_rc11-r2.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/spl/spl-0.6.0_rc11-r2.ebuild,v 1.4 2012/12/29 17:01:12 ryao Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/spl/spl-0.6.0_rc11-r2.ebuild,v 1.5 2013/01/14 21:07:59 ryao Exp $ EAPI="4" AUTOTOOLS_AUTORECONF="1" @@ -54,9 +54,12 @@ src_prepare() { # Workaround for hard coded path sed -i "s|/sbin/lsmod|/bin/lsmod|" scripts/check.sh || die - # Linux 3.6 Support - epatch "${FILESDIR}/${P}-linux-3.6-compat.patch" - epatch "${FILESDIR}/${PN}-0.6.0_rc12-fix-3.6-compat-regression.patch" + if [ ${PV} != "9999" ] + then + # Linux 3.6 Support + epatch "${FILESDIR}/${P}-linux-3.6-compat.patch" + epatch "${FILESDIR}/${PN}-0.6.0_rc12-fix-3.6-compat-regression.patch" + fi autotools-utils_src_prepare } diff --git a/sys-kernel/spl/spl-0.6.0_rc13-r1.ebuild b/sys-kernel/spl/spl-0.6.0_rc13-r1.ebuild new file mode 100644 index 000000000000..b607f02a9992 --- /dev/null +++ b/sys-kernel/spl/spl-0.6.0_rc13-r1.ebuild @@ -0,0 +1,99 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/spl/spl-0.6.0_rc13-r1.ebuild,v 1.1 2013/01/14 21:07:59 ryao Exp $ + +EAPI="4" +AUTOTOOLS_AUTORECONF="1" + +inherit flag-o-matic linux-mod autotools-utils + +if [[ ${PV} == "9999" ]] ; then + inherit git-2 + EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git" +else + inherit eutils versionator + MY_PV=$(replace_version_separator 3 '-') + SRC_URI="https://github.com/zfsonlinux/${PN}/archive/${PN}-${MY_PV}.tar.gz" + S="${WORKDIR}/${PN}-${PN}-${MY_PV}" + KEYWORDS="~amd64" +fi + +DESCRIPTION="The Solaris Porting Layer is a Linux kernel module which provides many of the Solaris kernel APIs" +HOMEPAGE="http://zfsonlinux.org/" + +LICENSE="GPL-2" +SLOT="0" +IUSE="custom-cflags debug debug-log" +RESTRICT="test" + +RDEPEND="!sys-devel/spl" + +AT_M4DIR="config" +AUTOTOOLS_IN_SOURCE_BUILD="1" + +pkg_setup() { + CONFIG_CHECK=" + !DEBUG_LOCK_ALLOC + !GRKERNSEC_HIDESYM + MODULES + KALLSYMS + !PAX_KERNEXEC_PLUGIN_METHOD_OR + ZLIB_DEFLATE + ZLIB_INFLATE + " + + kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required" + + [ ${PV} != "9999" ] && \ + { kernel_is le 3 8 || die "Linux 3.8 is the latest supported version."; } + + check_extra_config +} + +src_prepare() { + # Workaround for hard coded path + sed -i "s|/sbin/lsmod|/bin/lsmod|" scripts/check.sh || die + + if [ ${PV} != "9999" ] + then + # Fix on_each_cpu autotools to work correctly + epatch "${FILESDIR}/${P}-fix-on_each_cpu-autotools-check.patch" + + # Fix soft lockup regression + epatch "${FILESDIR}/${P}-fix-soft-lockup.patch" + fi + + autotools-utils_src_prepare +} + +src_configure() { + use custom-cflags || strip-flags + set_arch_to_kernel + local myeconfargs=( + --bindir="${EPREFIX}/bin" + --sbindir="${EPREFIX}/sbin" + --with-config=all + --with-linux="${KV_DIR}" + --with-linux-obj="${KV_OUT_DIR}" + $(use_enable debug) + $(use_enable debug-log) + ) + autotools-utils_src_configure +} + +src_test() { + if [[ ! -e /proc/modules ]] + then + die "Missing /proc/modules" + elif [[ $UID -ne 0 ]] + then + ewarn "Cannot run make check tests with FEATURES=userpriv." + ewarn "Skipping make check tests." + elif grep -q '^spl ' /proc/modules + then + ewarn "Cannot run make check tests with module spl loaded." + ewarn "Skipping make check tests." + else + autotools-utils_src_test + fi +} |