You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(37) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(6) |
Feb
|
Mar
(13) |
Apr
(3) |
May
(6) |
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
(3) |
Nov
(6) |
Dec
(8) |
2011 |
Jan
(11) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Marko O. <d0...@us...> - 2010-11-22 19:46:30
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "kdfs". The branch, make_kdfs_compile has been updated via df5c8a1e9e7ea4604a45a715bfc80dd663905001 (commit) via 55dbb5f8e2bc62c8c022e72390910fc34a2b3ea8 (commit) via 21e74b00567f016af3ef7a51bc0049090bed919f (commit) via 419677e1341ff41458222f55a1f3eb4c75c1aac2 (commit) via f0b1b93dd8219f58a30f48b34c9f6e2453617037 (commit) via f1e224a569b4309ee9fab615a01fd9381c964744 (commit) via 87690c39ebd3c1e1ef05313a7af95c8118c45677 (commit) via c26952891d89d6b73613c8eddff865de36186fed (commit) via 5116f091b417e4a460475dab02f6d785940b965e (commit) via ff758e68cf18b81294f84bbe4fb58b005db0f89d (commit) via 329863ce76e65884a56389337c2869df7ec282a3 (commit) via 2a5ce3cd0f6909c79622fd48879e1389bf2b620e (commit) via a13ad4caf8604eb8fada26979b322e7117d82532 (commit) via 253ef30ea1ed1ab08501fc57c47c7247f25f3663 (commit) via c0fcdabf1333bf41ec7e6750294d1e7fe507ac12 (commit) via 06734a17409c70630f8f8341c0a2290bc78b2294 (commit) via 2a7733b714f7b4fca479154ca9bb5d929f21c8d8 (commit) via 0b34cc00f6b373f1ef019093b620f781011ea0d7 (commit) via 3e43260ff6e78dc4fc8ac6ba843ccd027663bb04 (commit) via 5e920c58ce00ed7ba69f8ae42c572fc5a5b0a2e8 (commit) via 0dd6af233d2a87867f13a4a666c4f6549b8a284e (commit) via b972c79827550d77f023a6441dacbfcffd17b30c (commit) via 1591581c338f28e44d4bfdede550023f532c97e8 (commit) via e7ab6e062f9e008252b16e2897dd86b188eb2b29 (commit) via 89f06731bbf72cd0aa6c5902a715e1daf91ba550 (commit) via 2e57cfd27ac06025dd3f34b7213b97cf42e77bd3 (commit) via 09262f050e055bd8e97fa3785b4322778f153d5a (commit) via 0f914ece90dcad9143c5b08a5f184c816eef03e8 (commit) via e80ed34adfa6e8ad40d6ee33e605d29424590a3e (commit) via 4ed663d9a9c14a9500ad058e28dd4533bbc92b67 (commit) via 95ae1cecf8a673f9b6645c6b1080690c3d69b1ae (commit) via 8c8cf17e3459af84c4906fed206a5d2a80a6a6dd (commit) via cf724c590002b8120c98ba3faaae4ed07f5c0f9b (commit) via 182c94e615f96ac704ccc900c67f42c8ecc09b6e (commit) via 43f19b499cc0b1b9b16bfb18787792020720b469 (commit) via 4531c65aef760b032b7c97fe8081285f5ca34ef0 (commit) via 6cb825f4f36c81315c1ca325acdf564aa0f220c6 (commit) via f5d4eeac4bf183c3a7f2d6e99dcfdeb62dc09e3e (commit) via da8e21c724c66ae8fc8204d1df3402580a02470e (commit) via d51fe35051eeb6fac82243626a153010bebbcdec (commit) via 94cc8525b086bdd3f50a2ca6f2b426f6a6ef47a8 (commit) via 159c94a5d365ba4cc83c6191ee6aa5bd46a82445 (commit) via e6654fb43bec6a31bf884f4d7208b72abcf3cba5 (commit) via 7b56e43e5e428b4cebc27dea15e02da312d74e54 (commit) via 380d349d215d55fb156be8d0d68f9252cc374a94 (commit) via 9bebf3e37c6d46891d2b37d9d077beb5887db3f7 (commit) via b2a80a85be3001b3679dd0c4deaeee7485543e59 (commit) via 0cf0cf7ed74dde680dc68530ff7ac9edda638e82 (commit) via 96f392b5ff1bc0f464bb7b204b60a4b492095352 (commit) via ab759b28277864d1e708fa0e76133b30d223957e (commit) via cdaf1217bcc45ddeb127b8b8f71b4adccd09efb2 (commit) via eb4fce70435d80759a22f69a7f7c27d14f772175 (commit) via b3ef76bce4d48ebefe4424b9fe89fbef70eb5145 (commit) via 59108193a891647de60dc76b17d26c2913d2fcd9 (commit) via d9745d8152f0e927ebfb96fbf4c0510919bf53a1 (commit) via b0c7759c5025b410d96ae1892c917d8ca24e0415 (commit) via fd0d7cd7e39e59993806070d856bf01e5254806b (commit) via 0bc90c8db002ae8b70dfa40a4e8dff85dde68bb2 (commit) via 854bdde0d2f598c33691d548075f08c357f9b1c6 (commit) via b6d11c08d5cd53d8fd9b1d86067ff86251c0d806 (commit) via e01c7a802003579f8502c1528a3be8fbf0a3d4c8 (commit) via dd6c8cfc0dba63844bec64dd00d4f218f005d918 (commit) via d4b3c901893ebf2f8b4b00443312935fb013e448 (commit) via 9446401b8edac0db7c58cbb57d85814650697bae (commit) via d152dc18afaf4fad926a42062aa5aec8320aeafd (commit) via a481197b7b60001006ec3171d284510d85507a39 (commit) via bc5cab308e45f99d7abc357d10ac46558e14ffbe (commit) via c72175babf8bc084f424a5d238b2ed7341dddd6c (commit) via 587452ec7587bdd20644e66db41bb1f4cbbd0cf5 (commit) via b7b2b6be6ff96b641b31fd07997435a5d9c5fa11 (commit) via 85d69c2dda1d94993fba6d296fc6728f9811dc82 (commit) via 633798acc613aec2482b2001ddbeb401e57a7f0a (commit) via 3f25a315c427222816b9bae182ef1e1d68e9f178 (commit) via 8663c0ae1bbaa2b02962903c1dc59c7e05dcd72e (commit) via ea36d6eb3a0cca17271f78d6a978915af41ff0a6 (commit) via 661e91e5aa7c5b08664efff351947aee4fe0d267 (commit) via e4e112fe40777d71a09b5c4d31c987e10add36a1 (commit) via 5d0651cdf8d5a137f281b3382cde75acf84d1dbf (commit) via 2dfa4269cd36e12a36db434d60b75a90232d4745 (commit) via 371a76f39980c283da3eae6e4560fb48feb8aa98 (commit) via 2152d72e7ec85e3f062be3c1916a36861d7bedd4 (commit) via 6bc611bdeba0b82a12eb6860c40ada14b39460f3 (commit) via 8e922c96b01fb0509adcbd84a4b12c88d4e349c1 (commit) via f918453f8b46760177347a9432d47c1910b54766 (commit) via 3888820da6017ebd370d1dfb119d2e0e2275ec5c (commit) via f09cb67d0850b0203d03b9df403dcdf31dd6f309 (commit) via 889e0631394f5f2ed502f69a3e787b0eee48a46a (commit) via d78e512683500ae5d5d978041c0df8cf024b040d (commit) via 240c8bccdee82f3bd9132aea94e8259a08ce3459 (commit) via b9cc8335769df8e33e22f9b87cc0d8a5682b6e07 (commit) via af5e4643e273d03a1066cc398824de21a0efdeff (commit) via 304bd20ae4707fe36c92707259bce6ba699b99f7 (commit) via 19104907d8f596b427d8f0522a848e42f51386c6 (commit) via 37be4a5e7a3d9bb03c69488635c539254bc2091e (commit) via fde5880cdbb4664fd6b543e27e1d4b33caf563f8 (commit) via 1ca6f1dad4749b736c3c855f5feec2cc180b2690 (commit) via 870d6fc10fa78eeea6bad48f854dec29c4895ef8 (commit) via ff7bcab633ffb7fe6fc5e698787bbb5b63bfab8d (commit) via b8261dcabd4f5d8bbd987edc5da3fa5e1f460cc0 (commit) via cd948aec2eacaa9fc3a57cf893cba0fd3eec0924 (commit) via 91c18c7439fc1b620ade32b4e8d7c234746f62c3 (commit) via 772fa24090b0d55600665d93d46d1d7d7558674d (commit) via d43b1e4bff29d34f1e20c8a1e8c0659927145cec (commit) via 0982caa625a1822a73825f32c155eafa591cf2ed (commit) via 3e8f3861ba8155e0a2f5bbfb50aac45842127b40 (commit) via aa76721ab36baf7aa4154fbf67f59509cc609261 (commit) via 4eeb669a384b627ef3980d7befa27c1bcf1c7dbc (commit) via f03135e1a5c55a16584ba33713ab4b26a6d55fbb (commit) via bd613f8c53bc726686d90dc09fcb7db8548018bb (commit) via 5c6c97d2db9a65a68c6c6475b99b096b229d9f56 (commit) via 2d65d963d98db1af52eda9f1fd01517a46400c63 (commit) via 265f1ba0f1e2e0bc2c7c683ac1bddb4423d486cf (commit) via 034b30977d388d286ca97d8ae31c5b7e04e68a50 (commit) via d8ea787b4a12590068623889a15f0668297e94dd (commit) via c10111ebc4c09d23ce69cc3f70bd2576fc1ba195 (commit) via bcca1d87ff4e20b1e2b182d85d9a370b00117676 (commit) via 483396113e10e7457dbd355c57d372d1ce4f54d4 (commit) via ff842d01e0da87e36d73c22ebc8d3bbbb11fa582 (commit) via 1c64f7dfc2548bd3044de26328e659197977530c (commit) via 73b30c14ba48cfdc15f541b69b535d5be0a467f5 (commit) via 449f0d86b7787b98dbb6e378927486c0023a61fa (commit) via 5d0f38b020fd8e6192a699ac85b887690cd795bb (commit) via 75d8b08d2f9eb809bc8402ce11e0ec67eba7be7a (commit) via e03c6375aff50e232ab712f4b3b919e862e15d43 (commit) via b2283f61ac96dabde8ef686ab4500ba398a1d20b (commit) via 25c465dc66d03482f792098a847f0d0335bf6491 (commit) via 6c36d0780e9313c62e85f81a7d5bb01bc6573770 (commit) via c999b772d4b82643e17311b3f25b30ceac7ebbe8 (commit) via edc2066c22d7bbbf44e667d1e2dd1df2ef27e183 (commit) via f2f34433dea8ea3290ea769430287853411ac743 (commit) via b116dd074d7cdd94bedc7b674c0c97f9d90a9c32 (commit) via dd5e478b0f5779ef69a6a53c3366079522dbb7cb (commit) via a35962bea8ad95d90910e02dc57e2618b8670ef6 (commit) via 700add1d03ac75d490c699db0828796a1b3f2395 (commit) via bd5417c408602166fa275943fa9c2fd868ef0933 (commit) via ccc929b363b497db0b2d5f6776ddec601c17c15e (commit) via e0e1a2ffa16ef1f0c082ac3dbc5decfda888acad (commit) via 9a8d4a88ff2751b4f856f877ce264433c4872e45 (commit) via b935b9ae690023f04eebef9fa0f3fda492eb850f (commit) via fed0ad621df2aed1423d2ba345dafcccdfada2d4 (commit) via 2fd35c7457b52a4f6e6071946c751736386cf089 (commit) via 4fbf8d2d79ddf7ecd9e0371f92c4d14a4898fae5 (commit) via 05934b4b8b8836f3ca2cf40fb39a005d88195c56 (commit) via 56a2d7b77edd3ecc5eded523884fe6acc30ff236 (commit) via 514aa74c5eed7d30e3592be781aaccf4513f944d (commit) via c0a84084c6e00f57ca7ff44ae5fa43e1ecace4b8 (commit) via 630fd546d840f716f02230e4bb392135cb1e1540 (commit) via b662b3db106dba2781361489eba5024e650c9c73 (commit) via 6124de08fd3a44dbe88d0a399d70f0f4e77c2b57 (commit) via d61dc734364e9de3102a344077354762c6396a82 (commit) via 88a2f04745c153e669702c6f709d42cc76bd73a7 (commit) via c30b5e43446b2a944cd451aff852e510ffe79166 (commit) via 7dac6f0239b9eaba26d045324831c2a1661eb619 (commit) via 6e56d95d71b500655c5039d4414568d4b496d29c (commit) via b3d09e35ba9d2e4380119632b539417a9acbdc44 (commit) via d424b9e1891857ca1f68658b82fb4f293da7d234 (commit) via 5666eab704d9b6909d86212889d3e7614e2f020b (commit) via 03a3071694012a56c71c69eaa7fbe1afaa4a1696 (commit) via 3534fdc907243714cb96f5fbecb3166f20ed920a (commit) via 0553d5e6be3aea46c4fb4ae735bec1498cbfc9f7 (commit) via 822da835a45733a6c36e44e61e38966166fb036b (commit) via e3cdf12a7e34f5ab2ebd518a4c6e33561ba98b6c (commit) via e0c35b6f5f0c97b8548e79dfa3d43984fc4671b7 (commit) via 6515e58c11b5edcfbb9da2a8018d263fa7504a0c (commit) via 041df067c64323907f61035a87f780880ac6bf08 (commit) via ab6ee6dfb0c6336010cb21cb4180de940ca270e0 (commit) via e92c86057a525ac2e771d38e17ef036dbd19ac1b (commit) via 2e84bdb26c2d7e42c68acc40907fe954520ec50d (commit) via dfbbb3f14558c260eac6fa88920cf128024e3333 (commit) via 430d2dea44401b9f3ab1a507f30354d86d6b0f82 (commit) via 1cbc9f137ec64b473652705bafd0cf87e522df2c (commit) via 21d644bfbb1cfea2eceae153e87b7e2ea6084fe9 (commit) via cb9d31569d87b467e27abd37f1325a438e6ab421 (commit) via 419b889786252714b4d4712c5946bfd65a49bcee (commit) via a9878961d9223a356334b899c74365f5d13a08c2 (commit) via 14074b410f383c45969e8cbf2b3156b925204893 (commit) via b5f843ba696473d5b67d48ddf01bdc4e7252d2da (commit) via 663fe3161ca50d48dbce735138e78698610696a4 (commit) via 7366ea7ab3bf9f8d4143a7f87cd4f167c3a9835b (commit) via 8f460030f85adccefb32986ee8679758f7bf380a (commit) via 6a654ef96717f88cd5a3414219eb1a7b46470f97 (commit) via 31e2ef3ed0c882095c9cf91bc0d75ccaba73bfba (commit) via d8d6093ab114e74361b56f23284c705dd5678d1c (commit) via 1786577af6ab12d30752671794d4dda264500524 (commit) via 9bd22da5042f0aff544af9d1fee8b599368c4355 (commit) via 3808f903f73f14ac5aa460dc4a556ede8a019460 (commit) via b1fa5b3480787a835ac312cfe462e3f60691d2e8 (commit) via e297c37be4997b82fd532c279460a97b76f64adb (commit) via d229280eed6322a67ddfebed7a8ecd803a3f983e (commit) via 8c01b0433d8cdf6201ecb4f6cec16bdd2cb06e5c (commit) via 78ab0405a4ed62d50a9ffd747e66030fbaa392c0 (commit) via 27af7215f7982f1bb16a29ee34e6cdda067b3457 (commit) via 57f857d6121d1d36635d6c38b5f4681cc2840665 (commit) via c83b82ffff87dfde73e9b46d7b32b470c7316903 (commit) via e643f2884fa57d661cdf497c88fe90abd4076944 (commit) via b0bd5598756e19ba075ccba767601d3e50ceb807 (commit) via 6312658fdcb1427234c0f1ca3205d2a87d98de6a (commit) via 1cd0aaad371df1d5c7acf1dea318886f5689185f (commit) via ece98905f9e89a98645cae27722b804a59eeb97e (commit) via d15c24a441cc286843c0dc5a99b562897b86a8da (commit) via d7354d46d126f4ba62fb60582724b265e472716c (commit) via c5d39f7f6fe8977c157d42c9d2d41e07404b8847 (commit) via 03acc4377bd7bd03afc344193804659b6c6ed766 (commit) via 513f8cbf3f7498c66792cedf3d7d6d02c5ae21a2 (commit) via caa6efaca663b791eebcd73425d8d7575050b518 (commit) via 3613f2c92e0feb6bfbadab80e94b54ce937570ec (commit) via 2d41576469c5235c8c9c26f4ef33fc6c6993abac (commit) via e737aac5577b4fbf52372d8c1bfb6d28a292b36d (commit) via 7af85eea5189e31c686edb4444232f3e131bf9c0 (commit) via 19758eb611cec4b71504ba10c00ea70bebd8ee96 (commit) via 04fa163f6119ebba6b46f189c31d39fbe379d469 (commit) via cd906814dacb9643614cf703ab922c866850c3f5 (commit) via 47253784976af900ddcf6f8c7f17ac629ec61c02 (commit) via 1402893db90926ae4ce6ece7b204cffd0e826fd7 (commit) via 5f6c79ca22df32dd4cc2ac52b93045661042b66b (commit) via 36526f7d27bf6abb665168c403765159a7cfcef6 (commit) from 65030ba36b4d7214031b9d05d33162080f68df5d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit df5c8a1e9e7ea4604a45a715bfc80dd663905001 Merge: 041df06 55dbb5f Author: Marko Obrovac <mar...@in...> Date: Mon Nov 22 21:42:38 2010 +0100 Merge branch 'master' of git://mirrors.git.kernel.org/cluster/kerrighed/kernel into make_kdfs_compile diff --cc include/kddm/io_linker.h index b6fa1e0,494d83d..faae7c2 --- a/include/kddm/io_linker.h +++ b/include/kddm/io_linker.h @@@ -65,7 -65,7 +65,8 @@@ enu KDDM_TEST_LINKER, MM_STRUCT_LINKER, PIDMAP_MAP_LINKER, + SB_LINKER, + UNIQUE_ID_LINKER, MAX_IO_LINKER, /* MUST always be the last one */ } ; diff --cc include/kddm/kddm_set.h index d0334e6,59e02ad..65a1372 --- a/include/kddm/kddm_set.h +++ b/include/kddm/kddm_set.h @@@ -72,47 -72,36 +72,48 @@@ enu enum { KDDM_SET_UNUSED, // 0 - TASK_KDDM_ID, // 1 - SIGNAL_STRUCT_KDDM_ID, // 2 - SIGHAND_STRUCT_KDDM_ID, // 3 - STATIC_NODE_INFO_KDDM_ID, // 4 - STATIC_CPU_INFO_KDDM_ID, // 5 - DYNAMIC_NODE_INFO_KDDM_ID, // 6 - DYNAMIC_CPU_INFO_KDDM_ID, // 7 - APP_KDDM_ID, // 8 - SHMID_KDDM_ID, // 9 - SHMKEY_KDDM_ID, // 10 - SHMMAP_KDDM_ID, // 11 - SEMARRAY_KDDM_ID, // 12 - SEMKEY_KDDM_ID, // 13 - SEMMAP_KDDM_ID, // 14 - SEMUNDO_KDDM_ID, // 15 - MSG_KDDM_ID, // 16 - MSGKEY_KDDM_ID, // 17 - MSGMAP_KDDM_ID, // 18 - MSGMASTER_KDDM_ID, // 19 - PID_KDDM_ID, // 20 - CHILDREN_KDDM_ID, // 21 - DVFS_FILE_STRUCT_KDDM_ID, // 22 - GLOBAL_LOCK_KDDM_SET_ID, // 23 - GLOBAL_CONFIG_KDDM_SET_ID, // 24 - KDDM_TEST4_DIST, // 25 - KDDM_TEST4_LOC, // 26 - KDDM_TEST4096, // 27 - MM_STRUCT_KDDM_ID, // 28 + KDFS_FILE_KDDM__ID, // 1 + KDFS_INODE_KDDM_ID, // 2 + KDFS_DENTRY_KDDM_ID, // 3 + TASK_KDDM_ID, // 4 + SIGNAL_STRUCT_KDDM_ID, // 5 + SIGHAND_STRUCT_KDDM_ID, // 6 + STATIC_NODE_INFO_KDDM_ID, // 7 + STATIC_CPU_INFO_KDDM_ID, // 8 + DYNAMIC_NODE_INFO_KDDM_ID, // 9 + DYNAMIC_CPU_INFO_KDDM_ID, // 10 + MEMORY_NODE_INFO_KDDM_ID, // 11 + STREAM_KDDM_ID, // 12 + SOCKET_KDDM_ID, // 13 + APP_KDDM_ID, // 14 + FUTEX_KDDM_ID, // 15 + SHMID_KDDM_ID, // 16 + SHMKEY_KDDM_ID, // 17 + SHMMAP_KDDM_ID, // 18 + SEMARRAY_KDDM_ID, // 19 + SEMKEY_KDDM_ID, // 20 + SEMMAP_KDDM_ID, // 21 + SEMUNDO_KDDM_ID, // 22 + MSG_KDDM_ID, // 23 + MSGKEY_KDDM_ID, // 24 + MSGMAP_KDDM_ID, // 25 + MSGMASTER_KDDM_ID, // 26 + DSTREAM_KDDM_ID, // 27 + DSTREAM_SOCKET_BASE, // 28 PIDMAP_MAP_KDDM_ID, // 29 + UNIQUE_ID_KDDM_ID, // 30 + DSTREAM_SOCKET_MAX = DSTREAM_SOCKET_BASE + AF_MAX, // + 32 = 60 + DSTREAM_PIPE_KDDM_ID, // 61 + PID_KDDM_ID, // 62 + CHILDREN_KDDM_ID, // 63 + DVFS_FILE_STRUCT_KDDM_ID, // 64 + GLOBAL_LOCK_KDDM_SET_ID, // 65 + GLOBAL_CONFIG_KDDM_SET_ID, // 66 + KDDM_TEST4_DIST, // 67 + KDDM_TEST4_LOC, // 68 + KDDM_TEST4096, // 69 + MM_STRUCT_KDDM_ID, // 70 + KDFS_SB_KDDM_ID, MIN_KDDM_ID, /* MUST always be the last one */ }; commit 55dbb5f8e2bc62c8c022e72390910fc34a2b3ea8 Author: Louis Rilling <lou...@ke...> Date: Tue Jun 15 00:28:06 2010 +0200 krgrpc: Optimize rpc_close() delay Instead of waiting 2 * RPC_MAX_TTL to be sure that the peer receives the last close ack, make the peer more aggressive in sending low-level acks at close time, and let rpc_close() return once last close ack is low-level acked. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/net/krgrpc/comlayer.c b/net/krgrpc/comlayer.c index 66bd0a6..bcb023d 100644 --- a/net/krgrpc/comlayer.c +++ b/net/krgrpc/comlayer.c @@ -543,6 +543,13 @@ exit_empty: lockdep_on(); } +static void __rpc_tx_elem_check_last_ack(struct rpc_tx_elem *elem) +{ + if (elem->h.rpcid == RPC_CLOSE + && (elem->h.flags & __RPC_HEADER_FLAGS_SRV_REPLY)) + rpc_connection_last_ack(elem->conn_set->conn[elem->h.client]); +} + static void tipc_cleanup_not_retx_worker(struct work_struct *work) { struct tx_engine *engine = container_of(work, struct tx_engine, cleanup_not_retx_work.work); @@ -577,6 +584,7 @@ static void tipc_cleanup_not_retx_worker(struct work_struct *work) next_iter: if(need_to_free){ list_del(&iter->tx_queue); + __rpc_tx_elem_check_last_ack(iter); rpc_connection_set_put(iter->conn_set); __rpc_tx_elem_free(iter); } @@ -1263,8 +1271,9 @@ static void tipc_handler(void *usr_handle, // Update the ack value sent by the other node if (h->link_ack_id > conn->send_ack_id){ conn->send_ack_id = h->link_ack_id; - if(conn->send_ack_id - conn->last_cleanup_ack - > ack_cleanup_window_size){ + if ((conn->send_ack_id - conn->last_cleanup_ack + > ack_cleanup_window_size) + || rpc_conn->state > RPC_CONN_ESTABLISHED) { conn->last_cleanup_ack = h->link_ack_id; cleanup_not_retx(); } @@ -1284,7 +1293,8 @@ static void tipc_handler(void *usr_handle, } // Check if we are receiving lot of packets but sending none - if (conn->consecutive_recv >= conn->max_consecutive_recv) + if (conn->consecutive_recv >= conn->max_consecutive_recv + || rpc_conn->state > RPC_CONN_ESTABLISHED) send_acks(conn); conn->consecutive_recv++; diff --git a/net/krgrpc/rpc_internal.h b/net/krgrpc/rpc_internal.h index 85350f5..b8efa51 100644 --- a/net/krgrpc/rpc_internal.h +++ b/net/krgrpc/rpc_internal.h @@ -294,6 +294,7 @@ struct rpc_connection *rpc_handle_new_connection(kerrighed_node_t node, const struct rpc_connect_msg *msg); int rpc_handle_complete_connection(struct rpc_connection *conn, int peer_id); int rpc_connection_check_state(struct rpc_connection *conn, enum rpcid rpcid); +void rpc_connection_last_ack(struct rpc_connection *conn); struct rpc_connection * rpc_communicator_get_connection(struct rpc_communicator *comm, commit 21e74b00567f016af3ef7a51bc0049090bed919f Author: Louis Rilling <lou...@ke...> Date: Fri Jun 4 16:57:38 2010 +0200 krgrpc: Interrupt RPCs waiting on data from a closed connection Note: If data was available in a receive queue, it may be lost. To avoid such loss, some synchronization is expected between the nodes before closing connections. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/net/krgrpc/rpc.c b/net/krgrpc/rpc.c index b94ae1f..4029134 100644 --- a/net/krgrpc/rpc.c +++ b/net/krgrpc/rpc.c @@ -656,6 +656,26 @@ out_end: return err; } +static void rpc_connection_cancel_descs(struct rpc_connection *conn) +{ + struct rpc_communicator *comm = conn->comm; + struct rpc_desc *desc; + + spin_lock_bh(&comm->desc_clt_lock); + do_each_desc(desc, comm->desc_clt) { + if (desc->rpcid != RPC_CLOSE + && desc->conn_set->conn[conn->peer_id] == conn) + rpc_desc_cancel_wait(desc, conn->peer_id); + } while_each_desc(desc, comm->desc_clt); + spin_unlock_bh(&comm->desc_clt_lock); + + spin_lock_bh(&conn->desc_done_lock); + do_each_desc(desc, conn->desc_srv) { + rpc_desc_cancel_wait(desc, 0); + } while_each_desc(desc, conn->desc_srv); + spin_unlock_bh(&conn->desc_done_lock); +} + static void rpc_connection_kill(struct work_struct *work) { struct rpc_connection *conn; @@ -722,7 +742,7 @@ static void rpc_connection_close_timeout(struct work_struct *work) static void handle_close(struct rpc_desc *desc, void *msg, size_t size) { struct rpc_connection *conn = desc->conn_set->conn[desc->client]; - bool do_autoclose = false; + bool do_autoclose = false, do_cancel_descs = false; int err; spin_lock_bh(&conn->state_lock); @@ -749,6 +769,8 @@ static void handle_close(struct rpc_desc *desc, void *msg, size_t size) do_autoclose = true; case RPC_CONN_ESTABLISHED: conn->state = RPC_CONN_CLOSE_WAIT; + if (!do_autoclose) + do_cancel_descs = true; break; case RPC_CONN_FIN_WAIT_1: conn->state = RPC_CONN_CLOSING; @@ -763,6 +785,8 @@ static void handle_close(struct rpc_desc *desc, void *msg, size_t size) } spin_unlock_bh(&conn->state_lock); + if (do_cancel_descs) + rpc_connection_cancel_descs(conn); if (do_autoclose) rpc_close(conn->comm, conn->peer); } @@ -853,6 +877,7 @@ zombify: spin_unlock_bh(&conn->state_lock); kill: + rpc_connection_cancel_descs(conn); rpc_connection_schedule_kill(conn); rpc_connection_put(conn); } diff --git a/net/krgrpc/rpc_internal.h b/net/krgrpc/rpc_internal.h index fb53b13..85350f5 100644 --- a/net/krgrpc/rpc_internal.h +++ b/net/krgrpc/rpc_internal.h @@ -253,6 +253,7 @@ int rpc_handle_new(struct rpc_desc* desc); void rpc_wake_up_thread(struct rpc_desc *desc); void rpc_desc_wake_up(struct rpc_desc *desc); +void rpc_desc_cancel_wait(struct rpc_desc *desc, kerrighed_node_t node); void rpc_new_desc_id_lock(struct rpc_communicator *comm, bool lock_table); void rpc_new_desc_id_unlock(struct rpc_communicator *comm, bool unlock_table); diff --git a/net/krgrpc/rpclayer.c b/net/krgrpc/rpclayer.c index e63f928..a498550 100644 --- a/net/krgrpc/rpclayer.c +++ b/net/krgrpc/rpclayer.c @@ -688,9 +688,6 @@ int __rpc_unpack_from_node(struct rpc_desc* desc, kerrighed_node_t node, BUG_ON(!desc); BUG_ON(rpc_desc_forwarded(desc)); - if (test_bit(__RPC_FLAGS_CLOSED, &desc_recv->flags)) - return -ECANCELED; - if (unlikely(test_bit(__RPC_FLAGS_REPOST, &desc_recv->flags))) atomic_set(&seq_id, atomic_read(&desc_recv->seq_id)); else @@ -699,6 +696,11 @@ int __rpc_unpack_from_node(struct rpc_desc* desc, kerrighed_node_t node, restart: spin_lock_bh(&desc->desc_lock); + if (test_bit(__RPC_FLAGS_CLOSED, &desc_recv->flags)) { + spin_unlock_bh(&desc->desc_lock); + return -ECANCELED; + } + /* Return rpc_signalacks ASAP */ if (unlikely(!list_empty(&desc_recv->list_signal_head))) { for (;;) { @@ -886,7 +888,9 @@ static kerrighed_node_t __rpc_check_return(struct rpc_desc *desc, int *value) for(node=0;node<KERRIGHED_MAX_NODES;node++){ if(desc->desc_recv[node] - && atomic_read(&desc->desc_recv[node]->nbunexpected)){ + && (atomic_read(&desc->desc_recv[node]->nbunexpected) + || test_bit(__RPC_FLAGS_CLOSED, + &desc->desc_recv[node]->flags))) { spin_unlock_bh(&desc->desc_lock); @@ -981,6 +985,32 @@ void rpc_desc_wake_up(struct rpc_desc *desc) wake_up_process(desc->thread); } +void rpc_desc_cancel_wait(struct rpc_desc *desc, kerrighed_node_t node) +{ + bool do_wakeup = false; + + spin_lock_bh(&desc->desc_lock); + switch (desc->type) { + case RPC_RQ_CLT: + do_wakeup = (desc->state == RPC_STATE_WAIT1 + && desc->wait_from == node) + || desc->state == RPC_STATE_WAIT; + break; + case RPC_RQ_SRV: + do_wakeup = desc->state == RPC_STATE_WAIT1 + || desc->state == RPC_STATE_WAIT; + break; + default: + BUG(); + } + + set_bit(__RPC_FLAGS_CLOSED, &desc->desc_recv[node]->flags); + + if (do_wakeup) + rpc_desc_wake_up(desc); + spin_unlock_bh(&desc->desc_lock); +} + int rpc_signal(struct rpc_desc* desc, int sigid) { if (desc->desc_send->flags & RPC_FLAGS_CLOSED) commit 419677e1341ff41458222f55a1f3eb4c75c1aac2 Author: Louis Rilling <lou...@ke...> Date: Fri Jun 4 16:53:46 2010 +0200 krgrpc: Introduce rpc_desc table iterators Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/net/krgrpc/rpc_internal.h b/net/krgrpc/rpc_internal.h index 18d24d9..fb53b13 100644 --- a/net/krgrpc/rpc_internal.h +++ b/net/krgrpc/rpc_internal.h @@ -214,6 +214,16 @@ struct rpc_desc *rpc_desc_table_find(struct hlist_head *table, unsigned long id) return NULL; } +#define do_each_desc(desc, table) do { \ + struct hlist_node *____pos; \ + int ____i; \ + for (____i = 0; ____i < RPC_DESC_TABLE_SIZE; ____i++) { \ + hlist_for_each_entry(desc, ____pos, &table[____i], list) + +#define while_each_desc(desc, table) \ + } \ +} while (0) + static inline void rpc_desc_table_add(struct hlist_head *table, struct rpc_desc *desc) { commit f0b1b93dd8219f58a30f48b34c9f6e2453617037 Author: Louis Rilling <lou...@ke...> Date: Fri Jun 4 12:59:11 2010 +0200 krgrpc: Invert precedence of desc->desc_lock and desc->hash_lock It is more usable to take a table lock before a table element's lock. Next commit will need it. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/net/krgrpc/rpclayer.c b/net/krgrpc/rpclayer.c index 8ad0ca8..e63f928 100644 --- a/net/krgrpc/rpclayer.c +++ b/net/krgrpc/rpclayer.c @@ -248,6 +248,7 @@ int __rpc_end_unpack_clean(struct rpc_desc* desc) int rpc_end(struct rpc_desc* desc, int flags) { struct rpc_desc_send *rpc_desc_send; + spinlock_t *hash_lock; int err; lockdep_off(); @@ -272,17 +273,18 @@ int rpc_end(struct rpc_desc* desc, int flags) BUG(); } - if (desc->hash_lock) { - spin_lock_bh(&desc->desc_lock); - spin_lock(desc->hash_lock); + hash_lock = desc->hash_lock; + if (hash_lock) { + spin_lock_bh(hash_lock); + spin_lock(&desc->desc_lock); desc->state = RPC_STATE_END; rpc_desc_table_remove(desc); - - spin_unlock(desc->hash_lock); desc->hash_lock = NULL; - spin_unlock_bh(&desc->desc_lock); + + spin_unlock(&desc->desc_lock); + spin_unlock_bh(hash_lock); } __rpc_emergency_send_buf_free(desc); commit f1e224a569b4309ee9fab615a01fd9381c964744 Author: Louis Rilling <lou...@ke...> Date: Fri Jun 4 16:39:21 2010 +0200 krgrpc: Use *_bit() on rpc_desc_recv->flags Closing connections will need to modify it concurrently to the desc's thread. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/net/krgrpc/comlayer.c b/net/krgrpc/comlayer.c index e633f8a..66bd0a6 100644 --- a/net/krgrpc/comlayer.c +++ b/net/krgrpc/comlayer.c @@ -1086,7 +1086,7 @@ static int tipc_handler_ordered(struct tipc_connection *conn, } /* Is the transaction still accepting packets? */ if (!(desc->state & RPC_STATE_MASK_VALID) || - (desc_recv->flags & RPC_FLAGS_CLOSED)) { + test_bit(__RPC_FLAGS_CLOSED, &desc_recv->flags)) { spin_unlock(hash_lock); goto out_put; } @@ -1116,7 +1116,7 @@ static int tipc_handler_ordered(struct tipc_connection *conn, /* Double-check withe desc->desc_lock held */ if (!(desc->state & RPC_STATE_MASK_VALID) || - (desc_recv->flags & RPC_FLAGS_CLOSED)) { + test_bit(__RPC_FLAGS_CLOSED, &desc_recv->flags)) { // This side is closed. Discard the packet spin_unlock(&desc->desc_lock); rpc_desc_elem_free(descelem); diff --git a/net/krgrpc/rpc_internal.h b/net/krgrpc/rpc_internal.h index e7c8339..18d24d9 100644 --- a/net/krgrpc/rpc_internal.h +++ b/net/krgrpc/rpc_internal.h @@ -50,7 +50,7 @@ struct rpc_desc_recv { struct list_head list_signal_head; struct rpc_desc_elem *iter; struct rpc_desc_elem *iter_provided; - int flags; + unsigned long flags; /* bitfield */ }; enum rpc_connection_state { diff --git a/net/krgrpc/rpclayer.c b/net/krgrpc/rpclayer.c index 6c39760..8ad0ca8 100644 --- a/net/krgrpc/rpclayer.c +++ b/net/krgrpc/rpclayer.c @@ -353,7 +353,7 @@ void rpc_cancel_unpack_from(struct rpc_desc *desc, kerrighed_node_t node) BUG_ON(rpc_desc_forwarded(desc)); - desc_recv->flags |= RPC_FLAGS_CLOSED; + set_bit(__RPC_FLAGS_CLOSED, &desc_recv->flags); /* TODO: send a notification to the sender so that it stops sending */ } @@ -497,7 +497,7 @@ int rpc_forward(struct rpc_desc *desc, kerrighed_node_t node) list_for_each_entry_reverse(elem, &queue, list_desc_elem) if (elem->flags & __RPC_HEADER_FLAGS_CANCEL_PACK) { - desc_recv->flags |= RPC_FLAGS_CLOSED; + set_bit(__RPC_FLAGS_CLOSED, &desc_recv->flags); err = -EPIPE; goto out_restore_queue; } @@ -686,10 +686,10 @@ int __rpc_unpack_from_node(struct rpc_desc* desc, kerrighed_node_t node, BUG_ON(!desc); BUG_ON(rpc_desc_forwarded(desc)); - if (desc_recv->flags & RPC_FLAGS_CLOSED) + if (test_bit(__RPC_FLAGS_CLOSED, &desc_recv->flags)) return -ECANCELED; - if (unlikely(desc_recv->flags & RPC_FLAGS_REPOST)) + if (unlikely(test_bit(__RPC_FLAGS_REPOST, &desc_recv->flags))) atomic_set(&seq_id, atomic_read(&desc_recv->seq_id)); else atomic_set(&seq_id, atomic_inc_return(&desc_recv->seq_id)); @@ -706,7 +706,7 @@ int __rpc_unpack_from_node(struct rpc_desc* desc, kerrighed_node_t node, if (flags & RPC_FLAGS_SIGACK) { spin_unlock_bh(&desc->desc_lock); rpc_desc_elem_free(descelem); - desc_recv->flags |= RPC_FLAGS_REPOST; + set_bit(__RPC_FLAGS_REPOST, &desc_recv->flags); return -ESIGACK; } /* Store discarded sigacks in a list to free them with @@ -762,7 +762,7 @@ int __rpc_unpack_from_node(struct rpc_desc* desc, kerrighed_node_t node, __rpc_end_unpack_clean_queue(&sigacks_head); if (desc_recv->iter->flags & __RPC_HEADER_FLAGS_CANCEL_PACK) { - desc_recv->flags |= RPC_FLAGS_CLOSED; + set_bit(__RPC_FLAGS_CLOSED, &desc_recv->flags); return -ECANCELED; } @@ -784,7 +784,7 @@ int __rpc_unpack_from_node(struct rpc_desc* desc, kerrighed_node_t node, BUG(); } - desc_recv->flags &= ~RPC_FLAGS_REPOST; + clear_bit(__RPC_FLAGS_REPOST, &desc_recv->flags); return 0; __restart: @@ -808,7 +808,7 @@ int __rpc_unpack_from_node(struct rpc_desc* desc, kerrighed_node_t node, desc_recv->iter_provided = descelem; spin_unlock_bh(&desc->desc_lock); - desc_recv->flags &= ~RPC_FLAGS_REPOST; + clear_bit(__RPC_FLAGS_REPOST, &desc_recv->flags); return 0; } @@ -820,7 +820,7 @@ int __rpc_unpack_from_node(struct rpc_desc* desc, kerrighed_node_t node, schedule(); if (signal_pending(current) && (flags & RPC_FLAGS_INTR)) { - desc_recv->flags |= RPC_FLAGS_REPOST; + set_bit(__RPC_FLAGS_REPOST, &desc_recv->flags); return -EINTR; } commit 87690c39ebd3c1e1ef05313a7af95c8118c45677 Author: Louis Rilling <lou...@ke...> Date: Fri Jun 4 15:39:44 2010 +0200 krgrpc: Factorize locking in do_action() Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/net/krgrpc/comlayer.c b/net/krgrpc/comlayer.c index 5908857..e633f8a 100644 --- a/net/krgrpc/comlayer.c +++ b/net/krgrpc/comlayer.c @@ -767,19 +767,16 @@ int do_action(struct rpc_desc *desc, struct __rpc_header *h) spin_unlock(&desc->desc_lock); return rpc_handle_new(desc); case RPC_STATE_WAIT1: - if (desc->type == RPC_RQ_CLT - && desc->wait_from != h->server) { - spin_unlock(&desc->desc_lock); + if (desc->type == RPC_RQ_CLT && desc->wait_from != h->server) break; - } case RPC_STATE_WAIT: rpc_desc_wake_up(desc); - spin_unlock(&desc->desc_lock); break; default: - spin_unlock(&desc->desc_lock); break; } + spin_unlock(&desc->desc_lock); + return 0; } commit c26952891d89d6b73613c8eddff865de36186fed Author: Louis Rilling <lou...@ke...> Date: Fri Jun 4 15:36:07 2010 +0200 krgrpc: Factorize out rpc_desc_wake_up() from do_action() The logic will be reused, so do not duplicate it. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/net/krgrpc/comlayer.c b/net/krgrpc/comlayer.c index d17ecb9..5908857 100644 --- a/net/krgrpc/comlayer.c +++ b/net/krgrpc/comlayer.c @@ -773,8 +773,7 @@ int do_action(struct rpc_desc *desc, struct __rpc_header *h) break; } case RPC_STATE_WAIT: - desc->state = RPC_STATE_RUN; - wake_up_process(desc->thread); + rpc_desc_wake_up(desc); spin_unlock(&desc->desc_lock); break; default: diff --git a/net/krgrpc/rpc_internal.h b/net/krgrpc/rpc_internal.h index cd5c629..e7c8339 100644 --- a/net/krgrpc/rpc_internal.h +++ b/net/krgrpc/rpc_internal.h @@ -242,6 +242,8 @@ int __rpc_signalack(struct rpc_desc* desc); int rpc_handle_new(struct rpc_desc* desc); void rpc_wake_up_thread(struct rpc_desc *desc); +void rpc_desc_wake_up(struct rpc_desc *desc); + void rpc_new_desc_id_lock(struct rpc_communicator *comm, bool lock_table); void rpc_new_desc_id_unlock(struct rpc_communicator *comm, bool unlock_table); int __rpc_emergency_send_buf_alloc(struct rpc_desc *desc, size_t size); diff --git a/net/krgrpc/rpclayer.c b/net/krgrpc/rpclayer.c index 5e0b68e..6c39760 100644 --- a/net/krgrpc/rpclayer.c +++ b/net/krgrpc/rpclayer.c @@ -973,6 +973,12 @@ int rpc_wait_all(struct rpc_desc *desc) return 0; } +void rpc_desc_wake_up(struct rpc_desc *desc) +{ + desc->state = RPC_STATE_RUN; + wake_up_process(desc->thread); +} + int rpc_signal(struct rpc_desc* desc, int sigid) { if (desc->desc_send->flags & RPC_FLAGS_CLOSED) commit 5116f091b417e4a460475dab02f6d785940b965e Author: Louis Rilling <lou...@ke...> Date: Tue Jun 1 16:55:44 2010 +0200 krgrpc: Implement rpc_connect() and rpc_close() This commit makes connections really dynamic. Connections IDs are now allocated using the IDR. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/include/net/krgrpc/rpcid.h b/include/net/krgrpc/rpcid.h index 6972d6f..b228ec8 100644 --- a/include/net/krgrpc/rpcid.h +++ b/include/net/krgrpc/rpcid.h @@ -3,6 +3,8 @@ enum rpcid { RPC_UNDEF, + RPC_CONNECT, + RPC_CLOSE, RPC_ACK, RPC_FORWARD_DATA, RPC_ADVERT_FORWARD, diff --git a/net/krgrpc/comlayer.c b/net/krgrpc/comlayer.c index 8667207..d17ecb9 100644 --- a/net/krgrpc/comlayer.c +++ b/net/krgrpc/comlayer.c @@ -270,6 +270,9 @@ static int __rpc_tx_elem_send(struct rpc_tx_elem *elem, int link_seq_index, struct tipc_connection *conn = to_ll(elem->conn_set->conn[node]); int err = 0; + if (conn->conn.state == RPC_CONN_TIME_WAIT) + goto out; + elem->h.link_seq_id = elem->link_seq_id[link_seq_index]; if (elem->h.link_seq_id <= conn->send_ack_id) goto out; @@ -329,7 +332,8 @@ static void __rpc_tx_elem_queue(struct rpc_tx_elem *elem) static void send_acks(struct tipc_connection *conn) { spin_lock_bh(&tipc_ack_list_lock); - if (list_empty(&conn->ack_list)) { + if (list_empty(&conn->ack_list) + && conn->conn.state != RPC_CONN_TIME_WAIT) { rpc_connection_get(&conn->conn); list_add_tail(&conn->ack_list, &tipc_ack_head); queue_delayed_work(krgcom_wq, &tipc_ack_work, 0); @@ -914,11 +918,21 @@ server_rpc_desc_setup(struct rpc_connection *conn, const struct __rpc_header *h) rpc_communicator_get(conn->comm); desc->comm = conn->comm; - nodes = krgnodemask_of_node(h->client); - desc->conn_set = rpc_connection_set_alloc(desc->comm, &nodes); - if (IS_ERR(desc->conn_set)) { - err = PTR_ERR(desc->conn_set); - goto err_conn_set; + /* Only RPC_CLOSE must be able to use an invalidated connection */ + if (h->rpcid == RPC_CLOSE) { + BUG_ON(h->client != conn->peer); + desc->conn_set = __rpc_connection_set_alloc(); + if (!desc->conn_set) + goto err_conn_set; + rpc_connection_get(conn); + desc->conn_set->conn[conn->peer] = conn; + } else { + nodes = krgnodemask_of_node(h->client); + desc->conn_set = rpc_connection_set_alloc(desc->comm, &nodes); + if (IS_ERR(desc->conn_set)) { + err = PTR_ERR(desc->conn_set); + goto err_conn_set; + } } desc->desc_id = h->desc_id; @@ -1130,9 +1144,16 @@ static inline int handle_one_packet(struct tipc_connection *conn, unsigned char const *data, unsigned int size) { - int err; + const struct __rpc_header *h = (void *)data; + int err = 0; - err = tipc_handler_ordered(conn, buf, data, size); + /* Silently drop packets sent after connection close */ + if (!rpc_connection_check_state(&conn->conn, h->rpcid)) + err = tipc_handler_ordered(conn, buf, data, size); + else + printk("krgrpc: Dropping packet after close " + "(rpcid=%d from=%d desc_id=%lu seq_id=%lu)!\n", + h->rpcid, h->from, h->desc_id, h->seq_id); if (!err) { if (conn->conn.peer == kerrighed_node_id) conn->send_ack_id = conn->recv_seq_id; @@ -1182,6 +1203,9 @@ static void schedule_run_rx_queue(struct tipc_connection *conn) { int queued; + if (conn->conn.state == RPC_CONN_TIME_WAIT) + return; + rpc_connection_get(&conn->conn); queued = queue_delayed_work(krgcom_wq, &conn->run_rx_queue_work, HZ / 2); if (!queued) @@ -1201,6 +1225,7 @@ static void tipc_handler(void *usr_handle, struct tipc_portid const *orig, struct tipc_name_seq const *dest) { + struct rpc_connection *rpc_conn; struct tipc_connection *conn; struct sk_buff_head *queue; struct sk_buff *__buf; @@ -1210,12 +1235,31 @@ static void tipc_handler(void *usr_handle, h = (struct __rpc_header*)data; BUG_ON(size != __buf->len); - conn = to_ll(rpc_find_get_connection(h->from)); - if (conn->peer_id == -1) - conn->peer_id = h->source_conn_id; - else - BUG_ON(conn->peer_id != h->source_conn_id); + if (h->target_conn_id == -1) { + BUG_ON(h->rpcid != RPC_CONNECT); + if (h->link_ack_id != 0) { + __WARN(); + return; + } + BUG_ON(h->link_seq_id != 1); + BUG_ON(h->seq_id != 1); + rpc_conn = rpc_handle_new_connection(h->from, h->source_conn_id, + (struct rpc_connect_msg *)(h + 1)); + } else { + rpc_conn = rpc_find_get_connection(h->target_conn_id); + } + if (!rpc_conn) { + __WARN(); + return; + } + if (rpc_conn->peer_id == -1) { + if (rpc_handle_complete_connection(rpc_conn, h->source_conn_id)) { + __WARN(); + return; + } + } + conn = to_ll(rpc_conn); queue = &conn->rx_queue; spin_lock(&queue->lock); @@ -1234,6 +1278,9 @@ static void tipc_handler(void *usr_handle, if (h->rpcid == RPC_ACK) goto exit; + if (rpc_conn->state == RPC_CONN_TIME_WAIT) + goto exit; + // Check if we are not receiving an already received packet if (h->link_seq_id < conn->recv_seq_id) { send_acks(conn); @@ -1280,7 +1327,7 @@ static void tipc_handler(void *usr_handle, exit: spin_unlock(&queue->lock); - rpc_connection_put(&conn->conn); + rpc_connection_put(rpc_conn); } static @@ -1399,6 +1446,8 @@ rpc_enable_lowmem_mode(struct rpc_communicator *comm, kerrighed_node_t nodeid) struct tipc_connection *ll; conn = rpc_communicator_get_connection(comm, nodeid); + if (!conn) + return; ll = to_ll(conn); ll->max_consecutive_recv = MAX_CONSECUTIVE_RECV__LOWMEM_MODE; @@ -1414,6 +1463,8 @@ rpc_disable_lowmem_mode(struct rpc_communicator *comm, kerrighed_node_t nodeid) struct tipc_connection *ll; conn = rpc_communicator_get_connection(comm, nodeid); + if (!conn) + return; ll = to_ll(conn); ll->max_consecutive_recv = MAX_CONSECUTIVE_RECV; rpc_connection_put(conn); @@ -1460,6 +1511,23 @@ void rpc_connection_free_ll(struct rpc_connection *conn) kfree(ll); } +void rpc_connection_kill_ll(struct rpc_connection *conn) +{ + struct tipc_connection *ll = to_ll(conn); + + BUG_ON(conn->state != RPC_CONN_TIME_WAIT); + + spin_lock_bh(&tipc_ack_list_lock); + if (!list_empty(&ll->ack_list)) + list_del_init(&ll->ack_list); + spin_unlock_bh(&tipc_ack_list_lock); + + cancel_delayed_work_sync(&ll->run_rx_queue_work); + spin_lock_bh(&ll->rx_queue.lock); + __skb_queue_purge(&ll->rx_queue); + spin_unlock_bh(&ll->rx_queue.lock); +} + int comlayer_init(void) { int res = 0; diff --git a/net/krgrpc/rpc.c b/net/krgrpc/rpc.c index 3a4d986..b94ae1f 100644 --- a/net/krgrpc/rpc.c +++ b/net/krgrpc/rpc.c @@ -6,6 +6,8 @@ #include <linux/module.h> #include <linux/kernel.h> +#include <linux/completion.h> +#include <linux/workqueue.h> #include <linux/smp.h> #include <linux/rcupdate.h> #include <linux/list.h> @@ -197,9 +199,12 @@ void rpc_disable_all(void) int i; for(i = 0; i < RPCID_MAX; i++) - rpc_disable(i); + if (i != RPC_CONNECT && i != RPC_CLOSE) + rpc_disable(i); } +static void rpc_connection_kill(struct work_struct *work); + int rpc_connection_alloc(struct rpc_communicator *comm, kerrighed_node_t node) { @@ -221,6 +226,10 @@ rpc_connection_alloc(struct rpc_communicator *comm, kerrighed_node_t node) rpc_communicator_get(comm); conn->comm = comm; conn->peer = node; + conn->state = RPC_CONN_CLOSED; + conn->connect_pending = 0; + spin_lock_init(&conn->state_lock); + init_completion(&conn->close_done); conn->peer_id = -1; @@ -235,9 +244,9 @@ rpc_connection_alloc(struct rpc_communicator *comm, kerrighed_node_t node) if (comm->conn[node]) goto unlock; - spin_lock_irq(&rpc_conn_lock); - err = idr_get_new_above(&rpc_conn_idr, conn, node, &conn->id); - spin_unlock_irq(&rpc_conn_lock); + spin_lock(&rpc_conn_lock); + err = idr_get_new(&rpc_conn_idr, conn, &conn->id); + spin_unlock(&rpc_conn_lock); if (err) goto unlock; @@ -262,6 +271,19 @@ err_idr: return err; } +static void rpc_connection_invalidate(struct rpc_connection *conn) +{ + struct rpc_communicator *comm = conn->comm; + kerrighed_node_t node = conn->peer; + + /* Make conn an inactive connection */ + spin_lock_bh(&rpc_comm_lock); + BUG_ON(comm->conn[node] != conn); + rcu_assign_pointer(comm->conn[node], NULL); + spin_unlock_bh(&rpc_comm_lock); + rpc_connection_put(conn); +} + static void rpc_connection_free(struct rcu_head *rcu) { struct rpc_communicator *comm; @@ -277,18 +299,11 @@ static void rpc_connection_free(struct rcu_head *rcu) void rpc_connection_release(struct kref *kref) { struct rpc_connection *conn; - unsigned long flags; - - BUG(); conn = container_of(kref, struct rpc_connection, kref); BUG_ON(conn->comm->conn[conn->peer] == conn); - spin_lock_irqsave(&rpc_conn_lock, flags); - idr_remove(&rpc_conn_idr, conn->id); - spin_unlock_irqrestore(&rpc_conn_lock, flags); - call_rcu(&conn->rcu, rpc_connection_free); } @@ -404,13 +419,442 @@ struct rpc_communicator *rpc_find_get_communicator(int id) return &static_communicator; } +static void rpc_connection_schedule_kill(struct rpc_connection *conn) +{ + INIT_DELAYED_WORK(&conn->kill_work, rpc_connection_kill); + schedule_delayed_work(&conn->kill_work, 2 * RPC_MAX_TTL); +} + +static void rpc_connection_delayed_time_wait(struct work_struct *work) +{ + struct rpc_connection *conn; + + conn = container_of(to_delayed_work(work), struct rpc_connection, kill_work); + + spin_lock_bh(&conn->state_lock); + BUG_ON(conn->state != RPC_CONN_CLOSING); + conn->state = RPC_CONN_TIME_WAIT; + spin_unlock_bh(&conn->state_lock); + + rpc_connection_schedule_kill(conn); +} + +/* Requires conn->state_lock held */ +static void rpc_connection_check_abort(struct rpc_connection *conn, bool delay) +{ + if (conn->state != RPC_CONN_CLOSED || conn->connect_pending) + return; + + rpc_connection_invalidate(conn); + if (delay) { + conn->state = RPC_CONN_CLOSING; + INIT_DELAYED_WORK(&conn->kill_work, rpc_connection_delayed_time_wait); + schedule_delayed_work(&conn->kill_work, 2 * RPC_MAX_TTL); + } else { + conn->state = RPC_CONN_TIME_WAIT; + rpc_connection_schedule_kill(conn); + } +} + +/* Called in softirq context */ +struct rpc_connection *rpc_handle_new_connection(kerrighed_node_t node, + int peer_id, + const struct rpc_connect_msg *msg) +{ + struct rpc_communicator *comm; + struct rpc_connection *conn; + bool new; + int err; + + comm = rpc_find_get_communicator(msg->comm_id); + BUG_ON(!comm); + + conn = rpc_communicator_get_connection(comm, node); + if (!conn) { + err = rpc_connection_alloc(comm, node); + if (!err || err == -EBUSY) + conn = rpc_communicator_get_connection(comm, node); + else + conn = NULL; + if (!conn) + goto out; + } + + spin_lock(&conn->state_lock); + new = conn->peer_id == -1 && conn->state != RPC_CONN_TIME_WAIT; + if (new) { + BUG_ON(conn->state != RPC_CONN_CLOSED + && conn->state != RPC_CONN_SYNSENT); + conn->peer_id = peer_id; + conn->connect_pending = 1; + } + spin_unlock(&conn->state_lock); + if (!new && conn->peer_id != peer_id) { + /* + * Aborted connection, very old duplicate packet, + * or early reconnection + */ + rpc_connection_put(conn); + conn = NULL; + } + +out: + rpc_communicator_put(comm); + + return conn; +} + +/* Called in softirq context */ +int rpc_handle_complete_connection(struct rpc_connection *conn, int peer_id) +{ + int err = -EINVAL; + + spin_lock(&conn->state_lock); + if (conn->peer_id == -1 && conn->state != RPC_CONN_TIME_WAIT) { + BUG_ON(conn->state != RPC_CONN_SYNSENT); + conn->peer_id = peer_id; + err = 0; + } + /* else if (conn->peer_id == -1 && conn->state == RPC_CONN_TIME_WAIT) + Aborted connection + else if (conn->peer_id != peer_id) + Very old duplicate packet! + else duplicate packet */ + spin_unlock(&conn->state_lock); + + return err; +} + +static void handle_connect(struct rpc_desc *desc, void *msg, size_t size) +{ + struct rpc_connection *conn = desc->conn_set->conn[desc->client]; + int err; + + spin_lock_bh(&conn->state_lock); + conn->connect_pending = 0; + err = -EINVAL; + if (conn->state <= RPC_CONN_ESTABLISHED) + err = rpc_pack(desc, 0, NULL, 0); + if (err) { + rpc_cancel(desc); + rpc_connection_check_abort(conn, true); + } else if (conn->state == RPC_CONN_CLOSED) { + conn->state = RPC_CONN_ESTABLISHED_AUTOCLOSE; + } else if (conn->state == RPC_CONN_SYNSENT) { + conn->state = RPC_CONN_ESTABLISHED; + } + spin_unlock_bh(&conn->state_lock); +} + int rpc_connect(struct rpc_communicator *comm, kerrighed_node_t node) { + struct rpc_connect_msg msg; + struct rpc_connection *conn; + struct rpc_desc *desc; + bool do_close = false; + int err; + + err = rpc_connection_alloc(comm, node); + if (err && err != -EBUSY) + return err; + + desc = rpc_begin(RPC_CONNECT, comm, node); + if (!desc) { + conn = rpc_communicator_get_connection(comm, node); + if (conn) { + spin_lock_bh(&conn->state_lock); + rpc_connection_check_abort(conn, false); + spin_unlock_bh(&conn->state_lock); + rpc_connection_put(conn); + } + return -ENOMEM; + } + conn = desc->conn_set->conn[node]; + rpc_connection_get(conn); + + spin_lock_bh(&conn->state_lock); + + switch (conn->state) { + case RPC_CONN_CLOSED: + msg.comm_id = comm->id; + err = rpc_pack_type(desc, msg); + if (!err) + conn->state = RPC_CONN_SYNSENT; + else + rpc_connection_check_abort(conn, false); + spin_unlock_bh(&conn->state_lock); + if (err) + goto out_end; + break; + case RPC_CONN_ESTABLISHED_AUTOCLOSE: + conn->state = RPC_CONN_ESTABLISHED; + /* Fallthrough */ + case RPC_CONN_ESTABLISHED: + spin_unlock_bh(&conn->state_lock); + err = 0; + goto out_end; + case RPC_CONN_AUTOCLOSING: + case RPC_CONN_CLOSE_WAIT: + case RPC_CONN_LAST_ACK: + case RPC_CONN_TIME_WAIT: + /* Auto-closing, already existing connection */ + err = -EAGAIN; + spin_unlock_bh(&conn->state_lock); + goto out_end; + default: + BUG(); + } + + err = rpc_unpack(desc, 0, NULL, 0); + if (err > 0) + err = -EPIPE; + + spin_lock_bh(&conn->state_lock); + + if (err) { + switch (conn->state) { + case RPC_CONN_SYNSENT: + conn->state = RPC_CONN_CLOSED; + rpc_connection_check_abort(conn, false); + break; + case RPC_CONN_ESTABLISHED: + err = 0; + break; + case RPC_CONN_CLOSE_WAIT: + do_close = true; + break; + default: + BUG(); + } + goto out_unlock; + } + + switch (conn->state) { + case RPC_CONN_SYNSENT: + conn->state = RPC_CONN_ESTABLISHED; + /* Fallthrough */ + case RPC_CONN_ESTABLISHED: + break; + case RPC_CONN_CLOSE_WAIT: + do_close = true; + err = -EAGAIN; + break; + default: + BUG(); + } + +out_unlock: + spin_unlock_bh(&conn->state_lock); + +out_end: + rpc_end(desc, 0); + + if (do_close) + rpc_close(comm, conn->peer); + rpc_connection_put(conn); + + return err; +} + +static void rpc_connection_kill(struct work_struct *work) +{ + struct rpc_connection *conn; + + conn = container_of(to_delayed_work(work), struct rpc_connection, kill_work); + + spin_lock_bh(&rpc_conn_lock); + idr_remove(&rpc_conn_idr, conn->id); + spin_unlock_bh(&rpc_conn_lock); + + rpc_connection_kill_ll(conn); + rpc_connection_put(conn); +} + +/* Called in softirq context */ +int rpc_connection_check_state(struct rpc_connection *conn, enum rpcid rpcid) +{ + if (rpcid == RPC_CONNECT) + return 0; + + if (rpcid == RPC_CLOSE) { + spin_lock(&conn->state_lock); + if (conn->state == RPC_CONN_ESTABLISHED_AUTOCLOSE) + conn->state = RPC_CONN_AUTOCLOSING; + spin_unlock(&conn->state_lock); + return 0; + } + + if (conn->state > RPC_CONN_ESTABLISHED) + return -EPIPE; + return 0; } +/* Can be called in softirq context */ +void rpc_connection_last_ack(struct rpc_connection *conn) +{ + spin_lock_bh(&conn->state_lock); + switch (conn->state) { + case RPC_CONN_FIN_WAIT_2: + conn->state = RPC_CONN_TIME_WAIT; + complete(&conn->close_done); + break; + case RPC_CONN_CLOSING: + case RPC_CONN_CLOSE_WAIT: + case RPC_CONN_LAST_ACK: + case RPC_CONN_TIME_WAIT: + break; + default: + BUG(); + } + spin_unlock_bh(&conn->state_lock); +} + +static void rpc_connection_close_timeout(struct work_struct *work) +{ + struct rpc_connection *conn; + + conn = container_of(to_delayed_work(work), struct rpc_connection, timeout_work); + rpc_connection_last_ack(conn); + rpc_connection_put(conn); +} + +static void handle_close(struct rpc_desc *desc, void *msg, size_t size) +{ + struct rpc_connection *conn = desc->conn_set->conn[desc->client]; + bool do_autoclose = false; + int err; + + spin_lock_bh(&conn->state_lock); + do { + switch (conn->state) { + case RPC_CONN_ESTABLISHED: + case RPC_CONN_AUTOCLOSING: + case RPC_CONN_FIN_WAIT_1: + case RPC_CONN_FIN_WAIT_2: + err = rpc_pack(desc, 0, NULL, 0); + if (err) { + spin_unlock_bh(&conn->state_lock); + __set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(HZ); + spin_lock_bh(&conn->state_lock); + } + break; + default: + BUG(); + } + } while (err); + switch (conn->state) { + case RPC_CONN_AUTOCLOSING: + do_autoclose = true; + case RPC_CONN_ESTABLISHED: + conn->state = RPC_CONN_CLOSE_WAIT; + break; + case RPC_CONN_FIN_WAIT_1: + conn->state = RPC_CONN_CLOSING; + break; + case RPC_CONN_FIN_WAIT_2: + rpc_connection_get(conn); + INIT_DELAYED_WORK(&conn->timeout_work, rpc_connection_close_timeout); + schedule_delayed_work(&conn->timeout_work, 2 * RPC_MAX_TTL); + break; + default: + BUG(); + } + spin_unlock_bh(&conn->state_lock); + + if (do_autoclose) + rpc_close(conn->comm, conn->peer); +} + void rpc_close(struct rpc_communicator *comm, kerrighed_node_t node) { + struct rpc_connection *conn, *tmp_conn; + struct rpc_desc *desc; + int err; + + conn = rpc_communicator_get_connection(comm, node); + BUG_ON(!conn); + + while (!(desc = rpc_begin(RPC_CLOSE, comm, node))) { + /* + * In case of concurrent rpc_close(), + * rpc_begin() may fail because conn is no longer an active + * connection (ie no longer in the communicator). + * But we forbid concurrent rpc_close()! + */ + tmp_conn = rpc_communicator_get_connection(comm, node); + BUG_ON(tmp_conn != conn); + rpc_connection_put(tmp_conn); + + __set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(HZ); + } + /* Concurrent rpc_close() are forbidden! */ + BUG_ON(conn != desc->conn_set->conn[node]); + + rpc_connection_invalidate(conn); + + spin_lock_bh(&conn->state_lock); + + do { + switch (conn->state) { + case RPC_CONN_ESTABLISHED: + case RPC_CONN_CLOSE_WAIT: + err = rpc_pack(desc, 0, NULL, 0); + if (err) { + spin_unlock_bh(&conn->state_lock); + __set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(HZ); + spin_lock_bh(&conn->state_lock); + } + break; + default: + BUG(); + } + } while (err); + + switch (conn->state) { + case RPC_CONN_ESTABLISHED: + conn->state = RPC_CONN_FIN_WAIT_1; + break; + case RPC_CONN_CLOSE_WAIT: + conn->state = RPC_CONN_LAST_ACK; + break; + default: + BUG(); + } + + spin_unlock_bh(&conn->state_lock); + + err = rpc_unpack(desc, 0, NULL, 0); + rpc_end(desc, 0); + + spin_lock_bh(&conn->state_lock); + + if (err) + goto zombify; + + switch (conn->state) { + case RPC_CONN_FIN_WAIT_1: + conn->state = RPC_CONN_FIN_WAIT_2; + spin_unlock_bh(&conn->state_lock); + wait_for_completion(&conn->close_done); + goto kill; + case RPC_CONN_CLOSING: + case RPC_CONN_LAST_ACK: + break; + default: + BUG(); + } + +zombify: + conn->state = RPC_CONN_TIME_WAIT; + spin_unlock_bh(&conn->state_lock); + +kill: + rpc_connection_schedule_kill(conn); + rpc_connection_put(conn); } static @@ -537,12 +981,6 @@ int init_rpc(void) res = rpc_communicator_init(&static_communicator, 0); if (res) panic("kerrighed: Couldn't allocate static_communicator!\n"); - for (i = 0; i < KERRIGHED_MAX_NODES; i++) { - if (rpc_connection_alloc(&static_communicator, i)) - panic("kerrighed: Couldn't allocate static" - "connection!\n"); - BUG_ON(static_communicator.conn[i]->id != i); - } res = thread_pool_init(); if(res) @@ -556,6 +994,17 @@ int init_rpc(void) if(res) return res; + res = rpc_register_void(RPC_CONNECT, handle_connect, 0); + if (res) + return res; + + res = rpc_register_void(RPC_CLOSE, handle_close, 0); + if (res) + return res; + + rpc_enable(RPC_CONNECT); + rpc_enable(RPC_CLOSE); + /* res = rpc_monitor_init(); */ /* if(res) */ /* return res; */ diff --git a/net/krgrpc/rpc_internal.h b/net/krgrpc/rpc_internal.h index 729379a..cd5c629 100644 --- a/net/krgrpc/rpc_internal.h +++ b/net/krgrpc/rpc_internal.h @@ -6,6 +6,7 @@ #include <linux/hash.h> #include <linux/spinlock.h> #include <linux/rcupdate.h> +#include <linux/workqueue.h> #include <linux/radix-tree.h> #include <linux/slab.h> #include <linux/kref.h> @@ -13,6 +14,9 @@ #include <kerrighed/krgnodemask.h> #include <net/krgrpc/rpc.h> +/* Packets are not expected to be retransmitted after 1 min */ +#define RPC_MAX_TTL 60 * HZ + #define __RPC_HEADER_FLAGS_SIGNAL (1<<0) #define __RPC_HEADER_FLAGS_SIGACK (1<<1) #define __RPC_HEADER_FLAGS_SRV_REPLY (1<<3) @@ -49,6 +53,24 @@ struct rpc_desc_recv { int flags; }; +enum rpc_connection_state { + RPC_CONN_CLOSED, + RPC_CONN_SYNSENT, + RPC_CONN_ESTABLISHED_AUTOCLOSE, + RPC_CONN_ESTABLISHED, + RPC_CONN_AUTOCLOSING, + RPC_CONN_CLOSE_WAIT, + RPC_CONN_LAST_ACK, + RPC_CONN_FIN_WAIT_1, + RPC_CONN_FIN_WAIT_2, + RPC_CONN_CLOSING, + RPC_CONN_TIME_WAIT, +}; + +struct rpc_connect_msg { + int comm_id; +}; + struct rpc_connection { struct hlist_head desc_srv[RPC_DESC_TABLE_SIZE]; unsigned long desc_done_id; @@ -58,6 +80,12 @@ struct rpc_connection { int id; int peer_id; kerrighed_node_t peer; + enum rpc_connection_state state; + unsigned int connect_pending:1; + spinlock_t state_lock; + struct completion close_done; + struct delayed_work kill_work; + struct delayed_work timeout_work; struct rcu_head rcu; }; @@ -231,6 +259,7 @@ void __rpc_get_raw_data(void *raw); struct rpc_connection * rpc_connection_alloc_ll(struct rpc_communicator *comm, kerrighed_node_t node); void rpc_connection_free_ll(struct rpc_connection *connection); +void rpc_connection_kill_ll(struct rpc_connection *connection); int rpc_connection_alloc(struct rpc_communicator *comm, kerrighed_node_t node); @@ -247,6 +276,11 @@ static inline void rpc_connection_put(struct rpc_connection *connection) } struct rpc_connection *rpc_find_get_connection(int id); +struct rpc_connection *rpc_handle_new_connection(kerrighed_node_t node, + int peer_id, + const struct rpc_connect_msg *msg); +int rpc_handle_complete_connection(struct rpc_connection *conn, int peer_id); +int rpc_connection_check_state(struct rpc_connection *conn, enum rpcid rpcid); struct rpc_connection * rpc_communicator_get_connection(struct rpc_communicator *comm, commit ff758e68cf18b81294f84bbe4fb58b005db0f89d Author: Louis Rilling <lou...@ke...> Date: Wed Apr 7 18:42:18 2010 +0200 krgrpc: Factorize out parts of __rpc_send_ll() Future retx-enabled send routines will reuse some of the __rpc_tx_elem logic, so make it available without duplicating code. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/net/krgrpc/comlayer.c b/net/krgrpc/comlayer.c index f3b75b6..8667207 100644 --- a/net/krgrpc/comlayer.c +++ b/net/krgrpc/comlayer.c @@ -228,6 +228,42 @@ static void __rpc_tx_elem_free(struct rpc_tx_elem *elem) kmem_cache_free(rpc_tx_elem_cachep, elem); } +static void __rpc_tx_elem_init(struct rpc_tx_elem *elem, + struct rpc_connection_set *conn_set, + const krgnodemask_t *nodes, + enum rpcid rpcid, + int flags, + size_t size) +{ + struct tipc_connection *conn; + int link_seq_index; + kerrighed_node_t node; + + rpc_connection_set_get(conn_set); + elem->conn_set = conn_set; + __krgnodes_copy(&elem->nodes, nodes); + + link_seq_index = 0; + __for_each_krgnode_mask(node, nodes) { + conn = to_ll(conn_set->conn[node]); + elem->link_seq_id[link_seq_index] = + atomic_long_inc_return(&conn->send_seq_id); + link_seq_index++; + } + + elem->index = 0; + elem->link_seq_index = 0; + + elem->h.from = kerrighed_node_id; + elem->h.rpcid = rpcid; + elem->h.flags = flags; + + elem->iov[0].iov_base = &elem->h; + elem->iov[0].iov_len = sizeof(elem->h); + elem->iov[1].iov_base = elem->data; + elem->iov[1].iov_len = size; +} + static int __rpc_tx_elem_send(struct rpc_tx_elem *elem, int link_seq_index, kerrighed_node_t node) { @@ -245,6 +281,51 @@ out: return err; } +static void __rpc_tx_elem_queue(struct rpc_tx_elem *elem) +{ + struct tx_engine *engine; + kerrighed_node_t node; + int link_seq_index; + int err; + + preempt_disable(); + engine = &per_cpu(tipc_tx_engine, smp_processor_id()); + + if (irqs_disabled()) { + /* Add the packet in the tx_queue */ + lockdep_off(); + spin_lock(&tipc_tx_queue_lock); + list_add_tail(&elem->tx_queue, &engine->delayed_tx_queue); + spin_unlock(&tipc_tx_queue_lock); + lockdep_on(); + + /* Schedule the work ASAP */ + queue_work(krgcom_wq, &engine->delayed_tx_work.work); + preempt_enable(); + return; + } + + err = 0; + link_seq_index = 0; + for_each_krgnode_mask(node, elem->nodes) { + err =... [truncated message content] |
From: alebre <al...@us...> - 2010-10-08 17:11:18
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "kdfs". The branch, make_kdfs_compile has been updated via 65030ba36b4d7214031b9d05d33162080f68df5d (commit) via 60db9250b71c15b85a6f058f23e2a838d6bf558c (commit) via 12ae382bdd39c243f3360c52075703d5ce573dad (commit) via 44b237e9bdb6f2e58c96d6dac7f4306c9a307fee (commit) via 08ab3373b40a07e3de14c31a75f6551e71b4ad89 (commit) via 4268377e1278526746e621aff47b6cdb6548c4e3 (commit) via 7bae363f9e4506c0d7250db410060ce0e3ad3f39 (commit) via 608e96fd4fbf236a5036d167e33f84506dc00bd3 (commit) via aa01aa15edcc4d6d03ff78457c958fa7396696b5 (commit) via 6d13814baa28c0f3413bc73b4b2beee6a9a6969b (commit) via 4907e24a4e61263b79f812bb7a70c1bab7578e2a (commit) via caa1724797f5a4eca7473cec3046bb4a6802723e (commit) via 2f475998947562b5a67b89594a6af6d99e4dc22a (commit) via d6d59ea5922c3becd85514319fb75307947f5f4b (commit) via bb1326a63f9e04d9b7150ada1b2e7e0d5f1dc4ff (commit) via e6920b76e5487b0a81ec21f2458b4b1f90ad2530 (commit) via a910085f86c71a0cc856f60b6042baa772132688 (commit) via c2a9a6680e0c9e39dc3d6400845627b7fa4401a0 (commit) via 37d01f1de06a7cd06b089a0a895baa18cebc32f3 (commit) via 217ca954819eca9e6ec380ccf4d0bf39cd80f568 (commit) via 2d628dc0eb57538e3945c700ad8debef3cc36494 (commit) via 5a6f0c81657151a10fbb32f9587e24d37b09c811 (commit) via 02642261de7806489a6af2fc9c1652ae58cbbd9c (commit) via 3a4c6ff36599ef25d15f1a8cc4de72f6c1206e74 (commit) via 0b1fd8db149106374033e1f118d81b5227c9b7a9 (commit) via 97e13f853e3c4e327638a37d82ad18c8b185d7ba (commit) via 8961c6fc7865d44b19124ee381f8c4ec03446ea4 (commit) via cf02c71a9270cf26f275ae76f29b3561d18395af (commit) via 3f2380d0954d4ade2ece6bb8db7f5a4810102c1a (commit) via f1a6e6bd9cb52059d4fddba05523b3a17f73c9df (commit) via d090ddf48578f6d08e9f9ceca513537dc8468d7f (commit) via 8259677e32dfe60e443138bd0c9d7a2d99936fbe (commit) via e1551806c81dd3a8f4f573632e1031214235171d (commit) via 3236a0e566584450759a4661b896c33e4cd6dcf9 (commit) via 1282c77de60231c944b0971dafe684f27d9774ab (commit) via d053d966128e70cafc634dceeb855a7ca31d2c27 (commit) via bb50f0c07766096a4a43fb39960bedb46dd1b63e (commit) from 93feb2aa398019d78a5e95bd501ee47eb82e5031 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 65030ba36b4d7214031b9d05d33162080f68df5d Author: ad <leb...@fr...> Date: Fri Oct 8 09:12:04 2010 +0000 First striping validation diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index 12ba875..ca8b6e3 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -367,8 +367,10 @@ struct kdfs_page *kdfs_grab_distpage(struct kdfs_inode *k_inode, pgoff_t page_id DEBUG(DBG_INFO, "Gonna grab prevpage %ld from set %ld (objid = %ld)\n", page_id, k_inode->content_setid, objid); k_prevpage=kdfs_grab_page(k_inode->content_setid, objid); /* set the page's owner to this node */ + masternode = kerrighed_node_id ; kdfs_file_extent_set_page_owner(k_inode, page_id, masternode); + } objid = pageindex_to_contentobjid(masternode, page_id); @@ -376,12 +378,11 @@ struct kdfs_page *kdfs_grab_distpage(struct kdfs_inode *k_inode, pgoff_t page_id k_newpage=kdfs_grab_page(k_inode->content_setid, objid); if(k_prevpage){ - // TODO BUG set the reference to the local page to NULL, otherwise, k_prepage can still refer to the page managed by the - // kdfs k_newpage. + // Set the reference to the local page to NULL to avoid wrong manipulations + // (otherwise, k_prepage can still refer to the page managed by the kdfs k_newpage). k_prevpage->page=NULL; + k_prevpage->flags=K_PG_invalid; _kdfs_put_page(k_prevpage); - // TODO Now - Adrien : destroy the k_prevpage (memory leak) - } return k_newpage; @@ -530,6 +531,7 @@ int kdfs_iol_page_alloc(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid) pageid = contentobjid_to_pageindex(objid); DEBUG(DBG_INFO, "Before Alloc objid %ld from set %lu (page id %ld)\n", objid, set->id, pageid); + /* The page can be already in the cache, especially when we dynamically change the default owner */ k_page->page = find_get_page(k_mapping, pageid); if (!k_page->page) { DEBUG(DBG_ALERT, @@ -603,7 +605,7 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, k_page->offset = 0; k_page->to = PAGE_SIZE; - /* The page can be already in the cache, especially when we dynamically change the default owner */ + /* The page should be already in the cache if the get/grab has has been invoked by the VFS on the node (i.e kdfs_readpage) */ k_page->page = find_get_page(k_mapping, pageid); if (!k_page->page) { k_page->page = find_or_create_page(k_mapping, pageid, (mapping_gfp_mask(k_mapping)|__GFP_ZERO) & ~__GFP_FS); @@ -668,10 +670,10 @@ int kdfs_iol_page_insert(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid) * if the page has been created by kDFS, we should unlock the page * cf. find_or_create() in alloc and first touch */ - if(k_page->flags == K_PG_locked) { + if(k_page->flags == K_PG_locked) unlock_page(k_page->page); - k_page->flags=K_PG_ok; - } + + k_page->flags=K_PG_ok; page_cache_release(k_page->page); DEBUG(DBG_TRACE, "Exiting page count=%d\n", page_count(k_page->page)); @@ -701,26 +703,36 @@ int kdfs_iol_page_export (struct rpc_desc *desc, char *page_addr = NULL; PRINT_FUNCTION_NAME; - - DEBUG(DBG_INFO, "Gonna export objid %ld from set %ld\n", k_page->obj_id,k_page->set_id); - - page_addr = (char *) kmap_atomic(k_page->page, KM_USER0); - res = rpc_pack(desc, 0, page_addr, PAGE_SIZE); + DEBUG(DBG_INFO, "Gonna export objid %ld from set %ld with state\n", objid,k_page->set_id, k_page->flags); + res = rpc_pack(desc, 0, &k_page->flags, sizeof(k_page->flags)); if (res < 0) - DEBUG(DBG_ALERT, "can't pack export page (res=%d)\n", res); - - kunmap_atomic(page_addr, KM_USER0); + DEBUG(DBG_ALERT, "can't pack export page state (res=%d)\n", res); + else { + if(k_page->flags!=K_PG_invalid){ + // We should not export a page which is not consistent with + // the implicit striping mechanim. + + page_addr = (char *) kmap_atomic(k_page->page, KM_USER0); + - if (k_page->flags == K_PG_locked) { - /* - * if the page is still locked, it means that we are in the case of - * a remote grab: first_touch and export functions are the only ones called, - * insert is bypassed, so the page has not been unlock and released yet. - */ - unlock_page(k_page->page); - k_page->flags = K_PG_ok; - page_cache_release(k_page->page); + res = rpc_pack(desc, 0, page_addr, PAGE_SIZE); + if (res < 0) + DEBUG(DBG_ALERT, "can't pack export page (res=%d)\n", res); + + kunmap_atomic(page_addr, KM_USER0); + + if (k_page->flags == K_PG_locked) { + /* + * if the page is still locked, it means that we are in the case of + * a remote grab: first_touch and export functions are the only ones called, + * insert is bypassed, so the page has not been unlock and released yet. + */ + unlock_page(k_page->page); + k_page->flags = K_PG_ok; + page_cache_release(k_page->page); + } + } } PRINT_FUNCTION_EXIT; @@ -750,21 +762,29 @@ int kdfs_iol_page_invalidate(kddm_obj_t *objEntry, kddm_set_t *set, k_page=(struct kdfs_page *)objEntry->object; - /* - * the object to invalidate should concern the right page - */ - BUG_ON(contentobjid_to_pageindex(objid)!=k_page->page->index); + if(k_page->flags!=K_PG_invalid){ + // We should not try to access to a page through an object that is not consistent with + // the implicit striping mechanim. + // Indeed, it's mean that another object is in charge of managing the associated kernel page + // So, avoid the removal + + /* + * the object to invalidate should concern the right page + */ + BUG_ON(contentobjid_to_pageindex(objid)!=k_page->page->index); - DEBUG(DBG_INFO, "Try to invalidate objid %ld (page id %ld page addr %p) of set %lu\n", objid, k_page->page->index, k_page->page, set->id); + DEBUG(DBG_INFO, "Try to invalidate objid %ld (page id %ld page addr %p) of set %lu\n", objid, k_page->page->index, k_page->page, set->id); - trylock_page(k_page->page); - remove_from_page_cache(k_page->page); - set_page_private(k_page->page, 0); - ClearPagePrivate(k_page->page); - k_page->flags = K_PG_locked; - //unlock_page(k_page->page); - //page_cache_release(k_page->page); + trylock_page(k_page->page); + remove_from_page_cache(k_page->page); + set_page_private(k_page->page, 0); + ClearPagePrivate(k_page->page); + unlock_page(k_page->page); + page_cache_release(k_page->page); + } + kfree(k_page); + PRINT_FUNCTION_EXIT; return 0; @@ -786,16 +806,26 @@ int kdfs_iol_page_import(struct rpc_desc *desc, int flags) { int res = 0; - struct kdfs_page *kdfs_page = (struct kdfs_page*) objEntry->object; + struct kdfs_page *k_page = (struct kdfs_page*) objEntry->object; char *page_addr = NULL ; + /* WARNING: quite ugly, we should not access to a local inode without locking the corresponding kddm object*/ + /* What do you mean : locking the physical file, what kddm object ? the inode one ? */ + PRINT_FUNCTION_NAME; - page_addr = (char *) kmap(kdfs_page->page); + + res = rpc_unpack(desc, 0,&k_page->flags, sizeof(k_page->flags)); - res = rpc_unpack(desc, 0, page_addr, PAGE_SIZE); + DEBUG(DBG_INFO, "Gonna import objid %ld from set %ld with state\n", objid,k_page->set_id, k_page->flags); + if(!res && k_page->flags!=K_PG_invalid){ + // We should not import a page which is not consistent with + // the implicit striping mechanim. + page_addr = (char *) kmap(k_page->page); - kunmap(kdfs_page->page); + res = rpc_unpack(desc, 0, page_addr, PAGE_SIZE); + kunmap(k_page->page); + } PRINT_FUNCTION_EXIT; return res; } diff --git a/fs/kdfs/address_space.h b/fs/kdfs/address_space.h index ccc332a..7fd9901 100644 --- a/fs/kdfs/address_space.h +++ b/fs/kdfs/address_space.h @@ -29,7 +29,7 @@ /* local page has been locked by kDFS, so kDFS has to unlock */ #define K_PG_locked 1 -#define K_PG_used 2 +#define K_PG_invalid 2 /* If defined, kDFS provides local striping policy */ #define KDFS_FILE_STRIPING 1 commit 60db9250b71c15b85a6f058f23e2a838d6bf558c Author: ad <leb...@fr...> Date: Tue Oct 5 19:27:25 2010 +0000 [FIXED] Wrong page id diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index 79ddff4..12ba875 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -268,7 +268,9 @@ void kdfs_invalidatepage(struct page *page, unsigned long offset) /* TODO Should we really remove the page from the physical storage */ /* Currently only the inode is updated, it seems to be sufficient */ DEBUG(DBG_INFO, "Gonna invalidate page %ld (objid %ld from set %ld)\n", page->index, k_page->obj_id,k_page->set_id); - kddm_remove_object(kddm_def_ns, k_page->set_id, k_page->obj_id); + if(kddm_flush_object(kddm_def_ns, k_page->set_id, k_page->obj_id, KERRIGHED_NODE_ID_NONE) == -ENOSPC) + /* There is only one copy, so we should exploit remove instead of flush */ + kddm_remove_object(kddm_def_ns, k_page->set_id, k_page->obj_id); set_page_private(page, 0); ClearPagePrivate(page); @@ -514,6 +516,8 @@ int kdfs_iol_page_alloc(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid) { struct kdfs_page *k_page = NULL; struct address_space *k_mapping = NULL; + pgoff_t pageid; + PRINT_FUNCTION_NAME; ASSERT(set->private_data != NULL); @@ -523,13 +527,15 @@ int kdfs_iol_page_alloc(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid) k_page = kmalloc(sizeof(struct kdfs_page), GFP_KERNEL); ASSERT(k_page); - DEBUG(DBG_INFO, "Before Alloc objid %ld from set %lu (page id %ld)\n", objid, set->id, contentobjid_to_pageindex(objid)); - k_page->page = find_get_page(k_mapping, contentobjid_to_pageindex(objid)); + pageid = contentobjid_to_pageindex(objid); + + DEBUG(DBG_INFO, "Before Alloc objid %ld from set %lu (page id %ld)\n", objid, set->id, pageid); + k_page->page = find_get_page(k_mapping, pageid); if (!k_page->page) { DEBUG(DBG_ALERT, - "Can't find page for file/directory = %ld and page id = %ld, So created and locked\n", - k_mapping->host->i_ino, objid); - k_page->page = find_or_create_page(k_mapping, objid, mapping_gfp_mask(k_mapping) & ~__GFP_FS); + "Can't find page for file/directory = %ld and page id = %ld @mapping = %p, So created and locked\n", + k_mapping->host->i_ino, objid,k_mapping); + k_page->page = find_or_create_page(k_mapping, pageid, mapping_gfp_mask(k_mapping) & ~__GFP_FS); k_page->flags = K_PG_locked; } else k_page->flags = K_PG_ok; @@ -626,6 +632,7 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, kunmap(k_page->page); objEntry->object = (void *) k_page; + DEBUG(DBG_INFO, "After first touch, page %ld from set %lu (page addr=%p count=%d)\n", objid, set->id, k_page->page, page_count(k_page->page)); // Note: the page has not been release, this action should be perform // in the insert or export function according the kddm operation (get or grab) PRINT_FUNCTION_EXIT; @@ -694,6 +701,8 @@ int kdfs_iol_page_export (struct rpc_desc *desc, char *page_addr = NULL; PRINT_FUNCTION_NAME; + + DEBUG(DBG_INFO, "Gonna export objid %ld from set %ld\n", k_page->obj_id,k_page->set_id); page_addr = (char *) kmap_atomic(k_page->page, KM_USER0); @@ -752,8 +761,9 @@ int kdfs_iol_page_invalidate(kddm_obj_t *objEntry, kddm_set_t *set, remove_from_page_cache(k_page->page); set_page_private(k_page->page, 0); ClearPagePrivate(k_page->page); - unlock_page(k_page->page); - page_cache_release(k_page->page); + k_page->flags = K_PG_locked; + //unlock_page(k_page->page); + //page_cache_release(k_page->page); PRINT_FUNCTION_EXIT; diff --git a/fs/kdfs/dir.c b/fs/kdfs/dir.c index b378577..daef9c7 100644 --- a/fs/kdfs/dir.c +++ b/fs/kdfs/dir.c @@ -93,8 +93,8 @@ struct kdfs_dir_entry *kdfs_grab_entry (struct kdfs_inode *dir, const char *file do { DEBUG (DBG_INFO, "Grab page %ld:" - "page addr %p, dentry_addr %p (file size %lld)\n", - pageid, page_addr, dentry_addr, + "page addr (mapped %p, unmapped %p), dentry_addr %p (file size %lld)\n", + pageid, page_addr, tmp_page, dentry_addr, dir->inode->i_size); /* Get the directory entry */ dir_entry = (struct kdfs_dir_entry *) dentry_addr; commit 12ae382bdd39c243f3360c52075703d5ce573dad Merge: 93feb2a 44b237e Author: ad <leb...@fr...> Date: Mon Oct 4 06:13:19 2010 +0000 Merge branch 'master' of git://mirrors.git.kernel.org/cluster/kerrighed/kernel into make_kdfs_compile commit 44b237e9bdb6f2e58c96d6dac7f4306c9a307fee Author: Louis Rilling <lou...@ke...> Date: Wed Aug 25 16:52:23 2010 +0200 [BUILD] krg_ns: Fix build with KRG_PROC disabled Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/kerrighed/hotplug/namespace.c b/kerrighed/hotplug/namespace.c index 66503f2..6cda19b 100644 --- a/kerrighed/hotplug/namespace.c +++ b/kerrighed/hotplug/namespace.c @@ -57,9 +57,11 @@ int copy_krg_ns(struct task_struct *task, struct nsproxy *new) get_task_struct(task); ns->root_task = task; +#ifdef CONFIG_KRG_PROC BUG_ON(ns->root_nsproxy.pid_ns->krg_ns_root); ns->root_nsproxy.pid_ns->krg_ns_root = ns->root_nsproxy.pid_ns; +#endif rcu_assign_pointer(krg_ns, ns); } else { commit 08ab3373b40a07e3de14c31a75f6551e71b4ad89 Author: Renaud Lottiaux <Ren...@ke...> Date: Thu Sep 9 17:51:01 2010 +0200 [ENHANCEMENT] Add a KDDM object reference counter. The KDDM object mapcount counts the number of data structures sharing the object. This new refcount counts the number of tasks having a reference to the object. mapcount counts for 1 in the refcount, whatever its value if > 0. This new counter is usefull to fix some corner cases in the object removal case for instance. diff --git a/include/kddm/kddm_types.h b/include/kddm/kddm_types.h index 2ba94cc..6d58f3a 100644 --- a/include/kddm/kddm_types.h +++ b/include/kddm/kddm_types.h @@ -137,7 +137,10 @@ typedef struct { typedef struct kddm_obj { /* flags field must be kept first in the structure */ long flags; /* Flags, state, prob_owner, etc... */ - atomic_t mapcount; /* Number of structures sharing the object */ + atomic_t mapcount; /* Number of structures sharing the object. + * Mapping(s) count for 1 in refcount. + */ + atomic_t refcount; /* Reference counter */ masterObj_t master_obj; /* Object informations handled by the manager */ void *object; /* Kernel physical object struct */ diff --git a/include/kddm/object.h b/include/kddm/object.h index 9658d48..6dc0369 100644 --- a/include/kddm/object.h +++ b/include/kddm/object.h @@ -94,20 +94,29 @@ typedef enum { *--------------------------------------------------------------------------*/ - +extern struct kmem_cache *kddm_obj_cachep; extern atomic_t nr_master_objects; /*< Number of local master objects */ extern atomic_t nr_copy_objects; /*< Number of local copy objects */ extern atomic_t nr_OBJ_STATE[]; /*< Number of objects in each possible state */ extern const char *state_name[]; /*< Printable state name */ - /*--------------------------------------------------------------------------* * * * EXTERN FUNCTIONS * * * *--------------------------------------------------------------------------*/ +static inline void kddm_lock_obj_table(struct kddm_set * set) +{ + set->ops->lock_obj_table(set); +} + +static inline void kddm_unlock_obj_table(struct kddm_set * set) +{ + set->ops->unlock_obj_table(set); +} + static inline void lock_obj_entry(struct kddm_obj *obj_entry) { #ifdef CONFIG_DEBUG_SPINLOCK @@ -182,9 +191,33 @@ void free_kddm_obj_entry(struct kddm_set *set, struct kddm_obj *obj_entry, objid_t objid); +static inline void free_obj_entry_struct(struct kddm_obj *obj_entry) +{ + kmem_cache_free(kddm_obj_cachep, obj_entry); +} + +static inline void inc_obj_entry_refcount(struct kddm_obj *obj_entry) +{ + atomic_inc(&obj_entry->refcount); +} + +static inline void dec_obj_entry_refcount(struct kddm_set *set, + struct kddm_obj *obj_entry, + objid_t objid) +{ + if (atomic_dec_and_test(&obj_entry->refcount)) + free_kddm_obj_entry(set, obj_entry, objid); +} + +static inline int obj_entry_refcount(struct kddm_obj *obj_entry) +{ + return atomic_read(&obj_entry->refcount); +} + static inline void inc_obj_entry_mapcount(struct kddm_obj *obj_entry) { - atomic_inc(&obj_entry->mapcount); + if (atomic_inc_return(&obj_entry->mapcount) == 1) + inc_obj_entry_refcount(obj_entry); } static inline void dec_obj_entry_mapcount(struct kddm_set *set, @@ -192,7 +225,7 @@ static inline void dec_obj_entry_mapcount(struct kddm_set *set, objid_t objid) { if (atomic_dec_and_test(&obj_entry->mapcount)) - free_kddm_obj_entry(set, obj_entry, objid); + dec_obj_entry_refcount(set, obj_entry, objid); } static inline int obj_entry_mapcount(struct kddm_obj *obj_entry) @@ -200,6 +233,21 @@ static inline int obj_entry_mapcount(struct kddm_obj *obj_entry) return atomic_read(&obj_entry->mapcount); } +static inline int do_get_kddm_obj_entry (struct kddm_set *set, + struct kddm_obj *obj_entry, + objid_t objid) +{ + inc_obj_entry_refcount(obj_entry); + if (!trylock_obj_entry(obj_entry)) { + if (set) + kddm_unlock_obj_table(set); + wait_unlock_obj_entry(obj_entry); + dec_obj_entry_refcount(set, obj_entry, objid); + return -EAGAIN; + } + return 0; +} + /** Lookup for an object entry in a kddm set. * @author Renaud Lottiaux * @@ -246,8 +294,10 @@ static inline void put_kddm_obj_entry (struct kddm_set *set, struct kddm_obj *obj_entry, objid_t objid) { - if (obj_entry) + if (obj_entry) { unlock_obj_entry(obj_entry); + dec_obj_entry_refcount(set, obj_entry, objid); + } } struct kddm_obj *default_get_kddm_obj_entry (struct kddm_set *set, @@ -297,7 +347,6 @@ static inline struct kddm_obj *_get_alloc_kddm_obj_entry (struct kddm_ns *ns, return obj; } - static inline int do_func_on_obj_entry (struct kddm_set *set, struct kddm_obj *obj_entry, unsigned long objid, @@ -309,17 +358,18 @@ static inline int do_func_on_obj_entry (struct kddm_set *set, if (!obj_entry) return 0; - if (!trylock_obj_entry(obj_entry)) { - wait_unlock_obj_entry(obj_entry); + if (do_get_kddm_obj_entry(NULL, obj_entry, objid) == -EAGAIN) return -EAGAIN; - } + r = f(objid, obj_entry, data); /* Called functions are not allowed to return -EAGAIN */ BUG_ON (r == -EAGAIN); - if (r != KDDM_OBJ_REMOVED) - unlock_obj_entry(obj_entry); + if (r == KDDM_OBJ_REMOVED) + dec_obj_entry_mapcount(set, obj_entry, objid); + + put_kddm_obj_entry(set, obj_entry, objid); return r; } @@ -348,16 +398,6 @@ void kddm_insert_object (struct kddm_set *set, objid_t objid, struct kddm_obj * obj_entry, kddm_obj_state_t state); -static inline void kddm_lock_obj_table(struct kddm_set * set) -{ - set->ops->lock_obj_table(set); -} - -static inline void kddm_unlock_obj_table(struct kddm_set * set) -{ - set->ops->unlock_obj_table(set); -} - /** Change a kddm object state. * @author Renaud Lottiaux * diff --git a/kddm/kddm_set.c b/kddm/kddm_set.c index 1c637a4..1dea1b1 100644 --- a/kddm/kddm_set.c +++ b/kddm/kddm_set.c @@ -146,11 +146,6 @@ static int __free_kddm_obj_entry(unsigned long index, void *data, void *priv_data) { - struct kddm_obj *obj_entry = (struct kddm_obj *)data; - - unlock_obj_entry(obj_entry); - dec_obj_entry_mapcount((struct kddm_set *)priv_data, obj_entry, index); - return KDDM_OBJ_REMOVED; } diff --git a/kddm/kddm_tree.c b/kddm/kddm_tree.c index 6b863d0..6be8366 100644 --- a/kddm/kddm_tree.c +++ b/kddm/kddm_tree.c @@ -155,20 +155,21 @@ static void **kddm_tree_lookup_slot (struct kddm_tree *tree, * @return The address of the slot hosting the data. * If the data does not exist, an empty slot is allocated. */ -static void *__kddm_tree_remove (struct kddm_tree *tree, +static void *__kddm_tree_remove (struct kddm_set *set, struct kddm_tree_lvl *cur_level, int level, unsigned long index, int *_sub_level_freed) { + struct kddm_tree *tree = set->obj_set; struct kddm_tree_lvl *sub_level; int sub_index, sub_level_freed = 0; - void *data; + struct kddm_obj *obj_entry; sub_index = lvl_sub_index(tree, level, index); if ((level + 1) == tree->nr_level) { - data = cur_level->sub_lvl[sub_index]; + obj_entry = (struct kddm_obj *)cur_level->sub_lvl[sub_index]; goto free_sub_level_slot; } @@ -176,11 +177,11 @@ static void *__kddm_tree_remove (struct kddm_tree *tree, if (sub_level == NULL) return NULL; - data = __kddm_tree_remove(tree, sub_level, level+1, index, - &sub_level_freed); + obj_entry = __kddm_tree_remove(set, sub_level, level+1, index, + &sub_level_freed); if (sub_level_freed) goto free_sub_level_slot; - return data; + return obj_entry; free_sub_level_slot: cur_level->sub_lvl[sub_index] = NULL; @@ -190,7 +191,7 @@ free_sub_level_slot: kmem_cache_free(kddm_tree_lvl_cachep, cur_level); *_sub_level_freed = 1; } - return data; + return obj_entry; } @@ -199,13 +200,14 @@ free_sub_level_slot: * @param tree The tree to lookup in. * @param index The index of the data to remove. */ -static void *kddm_tree_remove(struct kddm_tree *tree, +static void *kddm_tree_remove(struct kddm_set *set, unsigned long index) { void *data; int sub_level_freed = 0; + struct kddm_tree *tree = set->obj_set; - data = __kddm_tree_remove(tree, tree->lvl1, 0, index, + data = __kddm_tree_remove(set, tree->lvl1, 0, index, &sub_level_freed); if (sub_level_freed) @@ -233,11 +235,15 @@ retry: sub_level = cur_level->sub_lvl[i]; if (sub_level != NULL) { if ((level + 1) == tree->nr_level) { - res = do_func_on_obj_entry(set, - (struct kddm_obj *)sub_level, - index, f, priv); + struct kddm_obj *obj_entry; + + obj_entry = (struct kddm_obj *)sub_level; + + res = do_func_on_obj_entry(set, obj_entry, + index, f, priv); if (res == -EAGAIN) goto retry; + sub_level_freed = (res == KDDM_OBJ_REMOVED); } else @@ -398,7 +404,7 @@ static struct kddm_obj *kddm_tree_get_obj_entry (struct kddm_set *set, static void kddm_tree_remove_obj_entry (struct kddm_set *set, objid_t objid) { - kddm_tree_remove (set->obj_set, objid); + kddm_tree_remove (set, objid); } diff --git a/kddm/object.c b/kddm/object.c index 7bd69a2..65309af 100644 --- a/kddm/object.c +++ b/kddm/object.c @@ -162,7 +162,8 @@ struct kddm_obj *alloc_kddm_obj_entry(struct kddm_set *set, obj_entry->flags = 0; obj_entry->object = NULL; - atomic_set(&obj_entry->mapcount, 1); + atomic_set(&obj_entry->mapcount, 0); + atomic_set(&obj_entry->refcount, 0); BUG_ON(set->def_owner < 0 || set->def_owner > KDDM_MAX_DEF_OWNER); @@ -206,7 +207,8 @@ struct kddm_obj *dup_kddm_obj_entry(struct kddm_obj *src_obj) *obj_entry = *src_obj; - atomic_set(&obj_entry->mapcount, 1); + atomic_set(&obj_entry->mapcount, 0); + atomic_set(&obj_entry->refcount, 1); CLEAR_OBJECT_PINNED(obj_entry); atomic_set(&obj_entry->sleeper_count, 0); init_waitqueue_head(&obj_entry->waiting_tsk); @@ -226,6 +228,7 @@ void free_kddm_obj_entry(struct kddm_set *set, { BUG_ON(object_frozen(obj_entry)); BUG_ON(obj_entry_mapcount(obj_entry) != 0); + BUG_ON(obj_entry_refcount(obj_entry) != 0); BUG_ON(is_locked_obj_entry(obj_entry)); BUG_ON(atomic_read(&obj_entry->sleeper_count) != 0); BUG_ON(TEST_OBJECT_PINNED(obj_entry)); @@ -236,7 +239,7 @@ void free_kddm_obj_entry(struct kddm_set *set, atomic_dec(&set->nr_entries); - kmem_cache_free(kddm_obj_cachep, obj_entry); + free_obj_entry_struct(obj_entry); } @@ -252,8 +255,8 @@ int destroy_kddm_obj_entry (struct kddm_set *set, BUG_ON (object_frozen(obj_entry)); /* Check if we are in a flush case i.e. cluster_wide_remove == 0 - * or if we have a pending request on the object. In both cases, can - * cannot remove the object entry. + * or if we have a pending request on the object. In both cases, we + * cannot destroy the object entry. */ if ((!cluster_wide_remove) || atomic_read (&obj_entry->sleeper_count)) { @@ -279,12 +282,16 @@ int destroy_kddm_obj_entry (struct kddm_set *set, atomic_dec(&set->nr_copies); } + /* Remove the object from the KDDM object table */ kddm_lock_obj_table(set); set->ops->remove_obj_entry(set, objid); kddm_unlock_obj_table(set); - put_kddm_obj_entry(set, obj_entry, objid); + /* Unmap the object */ dec_obj_entry_mapcount(set, obj_entry, objid); + + /* Put the reference taken by the called */ + put_kddm_obj_entry(set, obj_entry, objid); exit: return 0; } @@ -302,13 +309,9 @@ retry: kddm_lock_obj_table(set); obj_entry = set->ops->lookup_obj_entry(set, objid); - if (obj_entry) { - if (!trylock_obj_entry(obj_entry)) { - kddm_unlock_obj_table(set); - wait_unlock_obj_entry(obj_entry); + if (obj_entry) + if (do_get_kddm_obj_entry(set, obj_entry, objid) == -EAGAIN) goto retry; - } - } kddm_unlock_obj_table(set); @@ -336,13 +339,12 @@ retry: obj_entry = set->ops->get_obj_entry(set, objid, new_obj); if (obj_entry != new_obj) - dec_obj_entry_mapcount(set, new_obj, objid); + free_obj_entry_struct (new_obj); + else + inc_obj_entry_mapcount(obj_entry); - if (!trylock_obj_entry(obj_entry)) { - kddm_unlock_obj_table(set); - wait_unlock_obj_entry(obj_entry); + if (do_get_kddm_obj_entry(set, obj_entry, objid) == -EAGAIN) goto retry; - } kddm_unlock_obj_table(set); @@ -360,19 +362,18 @@ void kddm_insert_object(struct kddm_set * set, { BUG_ON(!is_locked_obj_entry(obj_entry)); - set_object_frozen(obj_entry); - unlock_obj_entry(obj_entry); - if (set->ops->insert_object) { kddm_lock_obj_table(set); set->ops->insert_object (set, objid, obj_entry); kddm_unlock_obj_table(set); } + set_object_frozen(obj_entry); + unlock_obj_entry(obj_entry); + kddm_io_insert_object(obj_entry, set, objid); lock_obj_entry(obj_entry); - object_clear_frozen(obj_entry, set); kddm_change_obj_state(set, obj_entry, objid, objectState); @@ -397,12 +398,10 @@ void kddm_invalidate_local_object_and_unlock(struct kddm_obj * obj_entry, { BUG_ON(obj_entry->object == NULL); - /* No need to take the obj_table lock since the COW operation does not - * change the table structure, it only update the entry of the object - * in the table. - */ + kddm_lock_obj_table(set); obj_entry = kddm_break_cow_object (set, obj_entry,objid, KDDM_BREAK_COW_INV); + kddm_unlock_obj_table(set); if (!obj_entry) goto done; @@ -444,7 +443,8 @@ void __sleep_on_kddm_obj(struct kddm_set * set, set_current_state(TASK_UNINTERRUPTIBLE); - put_kddm_obj_entry(set, obj_entry, objid); + /* Unlock the object but keep a reference on it. */ + unlock_obj_entry(obj_entry); if (kddm_info) { kddm_info->wait_obj = obj_entry; diff --git a/kerrighed/mm/page_table_tree.c b/kerrighed/mm/page_table_tree.c index aec1eee..3ed68ba 100644 --- a/kerrighed/mm/page_table_tree.c +++ b/kerrighed/mm/page_table_tree.c @@ -78,18 +78,17 @@ static inline struct page *replace_zero_page(struct mm_struct *mm, static inline struct kddm_obj *init_pte_alloc_obj_entry(struct kddm_set *set, objid_t objid, - struct kddm_obj **_obj_entry) + struct kddm_obj *_obj_entry) { struct kddm_obj *obj_entry; - if (!*_obj_entry) { + if (!_obj_entry) { obj_entry = alloc_kddm_obj_entry(set, objid); if (!obj_entry) BUG(); } else { - obj_entry = *_obj_entry; - *_obj_entry = NULL; + obj_entry = _obj_entry; change_prob_owner(obj_entry, kddm_io_default_owner(set, objid)); } @@ -104,18 +103,16 @@ static inline struct kddm_obj *init_swap_pte(struct mm_struct *mm, objid_t objid, struct kddm_obj *_obj_entry) { + unsigned long addr = objid * PAGE_SIZE; struct kddm_obj *obj_entry; swp_entry_t entry; if (pte_none(*ptep)) - return _obj_entry; + return NULL; if (pte_obj_entry(ptep)) { - obj_entry = get_obj_entry_from_pte(mm, objid * PAGE_SIZE, - ptep, NULL); - inc_obj_entry_mapcount(obj_entry); - BUG_ON(obj_entry_mapcount(obj_entry) == 1); - return _obj_entry; + obj_entry = get_obj_entry_from_pte(mm, addr, ptep, NULL); + goto done; } /* pte_file not yet supported */ @@ -127,7 +124,7 @@ static inline struct kddm_obj *init_swap_pte(struct mm_struct *mm, /* Migration entries not yet supported */ BUG_ON(is_migration_entry(entry)); - obj_entry = init_pte_alloc_obj_entry(set, objid, &_obj_entry); + obj_entry = init_pte_alloc_obj_entry(set, objid, _obj_entry); /* Set the first bit in order to distinguish pages from swap ptes */ obj_entry->object = (void *) mk_swap_pte_page(ptep); @@ -135,7 +132,10 @@ static inline struct kddm_obj *init_swap_pte(struct mm_struct *mm, set_swap_pte_obj_entry(ptep, obj_entry); - return _obj_entry; +done: + inc_obj_entry_mapcount(obj_entry); + + return obj_entry; } static inline struct kddm_obj *init_pte(struct mm_struct *mm, @@ -157,8 +157,10 @@ static inline struct kddm_obj *init_pte(struct mm_struct *mm, wait_lock_kddm_page(page); if (!PageAnon(page)) { - if (!(page == ZERO_PAGE(NULL))) - goto done; + if (!(page == ZERO_PAGE(NULL))) { + unlock_kddm_page(page); + return NULL; + } new_page = replace_zero_page(mm, vma, page, ptep, addr); /* new_page is returned locked */ unlock_kddm_page(page); @@ -166,14 +168,12 @@ static inline struct kddm_obj *init_pte(struct mm_struct *mm, } atomic_inc (&page->_kddm_count); - if (page->obj_entry != NULL) { - struct kddm_obj *obj_entry = page->obj_entry; - inc_obj_entry_mapcount(obj_entry); - BUG_ON(obj_entry_mapcount(obj_entry) == 1); + + obj_entry = page->obj_entry; + if (obj_entry) goto done; - } - obj_entry = init_pte_alloc_obj_entry(set, objid, &_obj_entry); + obj_entry = init_pte_alloc_obj_entry(set, objid, _obj_entry); BUG_ON (kddm_io_default_owner(set, objid) != kerrighed_node_id); obj_entry->object = page; @@ -184,10 +184,13 @@ static inline struct kddm_obj *init_pte(struct mm_struct *mm, BUG_ON (page->obj_entry != NULL); page->obj_entry = obj_entry; + done: + inc_obj_entry_mapcount(obj_entry); + unlock_kddm_page(page); - return _obj_entry; + return obj_entry; } @@ -224,8 +227,9 @@ struct kddm_obj *get_obj_entry_from_pte(struct mm_struct *mm, unlock_kddm_page(page); } else { - if ((pte_val(*ptep) == 0) && new_obj) + if ((pte_val(*ptep) == 0) && new_obj) { set_pte_obj_entry(ptep, new_obj); + } if (pte_obj_entry(ptep)) obj_entry = get_pte_obj_entry(ptep); @@ -271,6 +275,7 @@ static inline void __pt_for_each_pte(struct kddm_set *set, struct kddm_obj *obj_entry, *new_obj = NULL; unsigned long addr; spinlock_t *ptl; + objid_t objid; pte_t *ptep; int ret; @@ -284,43 +289,46 @@ static inline void __pt_for_each_pte(struct kddm_set *set, ptep = pte_offset_map_lock(mm, pmd, start, &ptl); + objid = start / PAGE_SIZE; for (addr = start; addr != end; addr += PAGE_SIZE) { if (f) { retry: obj_entry = get_obj_entry_from_pte(mm, addr, ptep, NULL); if (obj_entry) { - if (!trylock_obj_entry(obj_entry)) { - wait_unlock_obj_entry(obj_entry); + if (do_get_kddm_obj_entry(NULL, obj_entry, + objid) == -EAGAIN) goto retry; - } + pte_unmap_unlock(ptep, ptl); - ret = f(addr / PAGE_SIZE, obj_entry, priv); + + ret = f(objid, obj_entry, priv); if (ret == KDDM_OBJ_REMOVED) pte_clear(mm, addr, ptep); - else - unlock_obj_entry (obj_entry); + + put_kddm_obj_entry(set, obj_entry, objid); ptep = pte_offset_map_lock(mm, pmd, addr, &ptl); } } else { - new_obj = init_pte(mm, ptep, set, addr / PAGE_SIZE, - priv,new_obj); + obj_entry = init_pte(mm, ptep, set, objid, priv, + new_obj); /* The object has been used, allocate a new one */ - if (!new_obj) { + if (obj_entry == new_obj) { pte_unmap_unlock(ptep, ptl); new_obj = alloc_kddm_obj_entry(set, 0); ptep = pte_offset_map_lock(mm, pmd, addr, &ptl); } } + objid++; ptep++; } pte_unmap_unlock(ptep - 1, ptl); if (new_obj) - dec_obj_entry_mapcount(set, new_obj, 0); + free_obj_entry_struct (new_obj); } static inline void __pt_for_each_pmd(struct kddm_set *set, @@ -605,7 +613,6 @@ struct kddm_obj *kddm_pt_break_cow_object(struct kddm_set *set, } BUG_ON(obj_entry_mapcount(obj_entry) == 0); - BUG_ON(!is_locked_obj_entry(obj_entry)); if (page_kddm_count(old_page) == 1) { count = page_mapcount(old_page); @@ -625,9 +632,8 @@ struct kddm_obj *kddm_pt_break_cow_object(struct kddm_set *set, if (obj_entry_mapcount(obj_entry) != 1) { /* Page shared with another KDDM through the * swap cache. COW the obj entry. */ - dec_obj_entry_mapcount(set, obj_entry, objid); new_obj = dup_kddm_obj_entry(obj_entry); - unlock_obj_entry(obj_entry); + put_kddm_obj_entry(set, obj_entry, objid); } else { /* Page shared with a regular MM, no KDDM COW @@ -635,16 +641,16 @@ struct kddm_obj *kddm_pt_break_cow_object(struct kddm_set *set, * Reuse the obj entry. */ new_obj = obj_entry; } + dec_obj_entry_mapcount(set, obj_entry, objid); unlock_kddm_page(old_page); } } else { /* Page shared with another KDDM. COW the obj entry */ BUG_ON(atomic_dec_and_test(&old_page->_kddm_count)); - dec_obj_entry_mapcount(set, obj_entry, objid); - BUG_ON(obj_entry_mapcount(obj_entry) == 0); new_obj = dup_kddm_obj_entry(obj_entry); - unlock_obj_entry(obj_entry); + put_kddm_obj_entry(set, obj_entry, objid); + dec_obj_entry_mapcount(set, obj_entry, objid); unlock_kddm_page(old_page); } @@ -670,6 +676,7 @@ struct kddm_obj *kddm_pt_break_cow_object(struct kddm_set *set, /* Map the new page in the set mm */ __kddm_pt_insert_object (mm, new_page, addr, ptep, new_obj); + inc_obj_entry_mapcount(new_obj); pte_unmap_unlock(ptep, ptl); @@ -834,7 +841,6 @@ void kcb_zap_pte(struct mm_struct *mm, unsigned long addr, pte_t *ptep) struct kddm_set *set = mm->anon_vma_kddm_set; struct kddm_obj *obj_entry; struct page *page = NULL; - objid_t objid = addr / PAGE_SIZE; BUG_ON(!set); @@ -866,10 +872,11 @@ void kcb_zap_pte(struct mm_struct *mm, unsigned long addr, pte_t *ptep) unlock_kddm_page(page); } - if (atomic_dec_and_test(&obj_entry->mapcount)) { - obj_entry->object = NULL; - free_kddm_obj_entry(set, obj_entry, objid); - } + if (atomic_dec_and_test(&obj_entry->mapcount)) + if (atomic_dec_and_test(&obj_entry->refcount)) { + obj_entry->object = NULL; + free_kddm_obj_entry(set, obj_entry, addr / PAGE_SIZE); + } } commit 4268377e1278526746e621aff47b6cdb6548c4e3 Author: Renaud Lottiaux <Ren...@ke...> Date: Thu Sep 9 17:47:06 2010 +0200 [MINOR] Rename KDDM count into mapcount. diff --git a/include/kddm/kddm_types.h b/include/kddm/kddm_types.h index e2d575e..2ba94cc 100644 --- a/include/kddm/kddm_types.h +++ b/include/kddm/kddm_types.h @@ -137,7 +137,7 @@ typedef struct { typedef struct kddm_obj { /* flags field must be kept first in the structure */ long flags; /* Flags, state, prob_owner, etc... */ - atomic_t count; /* Number of structures sharing the object */ + atomic_t mapcount; /* Number of structures sharing the object */ masterObj_t master_obj; /* Object informations handled by the manager */ void *object; /* Kernel physical object struct */ diff --git a/include/kddm/object.h b/include/kddm/object.h index 4e19ef5..9658d48 100644 --- a/include/kddm/object.h +++ b/include/kddm/object.h @@ -182,17 +182,22 @@ void free_kddm_obj_entry(struct kddm_set *set, struct kddm_obj *obj_entry, objid_t objid); -static inline void put_obj_entry_count(struct kddm_set *set, - struct kddm_obj *obj_entry, - objid_t objid) +static inline void inc_obj_entry_mapcount(struct kddm_obj *obj_entry) { - if (atomic_dec_and_test(&obj_entry->count)) + atomic_inc(&obj_entry->mapcount); +} + +static inline void dec_obj_entry_mapcount(struct kddm_set *set, + struct kddm_obj *obj_entry, + objid_t objid) +{ + if (atomic_dec_and_test(&obj_entry->mapcount)) free_kddm_obj_entry(set, obj_entry, objid); } -static inline int obj_entry_count(struct kddm_obj *obj_entry) +static inline int obj_entry_mapcount(struct kddm_obj *obj_entry) { - return atomic_read(&obj_entry->count); + return atomic_read(&obj_entry->mapcount); } /** Lookup for an object entry in a kddm set. diff --git a/kddm/kddm_set.c b/kddm/kddm_set.c index 38226c7..1c637a4 100644 --- a/kddm/kddm_set.c +++ b/kddm/kddm_set.c @@ -149,7 +149,7 @@ static int __free_kddm_obj_entry(unsigned long index, struct kddm_obj *obj_entry = (struct kddm_obj *)data; unlock_obj_entry(obj_entry); - put_obj_entry_count((struct kddm_set *)priv_data, obj_entry, index); + dec_obj_entry_mapcount((struct kddm_set *)priv_data, obj_entry, index); return KDDM_OBJ_REMOVED; } diff --git a/kddm/object.c b/kddm/object.c index 916819c..7bd69a2 100644 --- a/kddm/object.c +++ b/kddm/object.c @@ -162,7 +162,7 @@ struct kddm_obj *alloc_kddm_obj_entry(struct kddm_set *set, obj_entry->flags = 0; obj_entry->object = NULL; - atomic_set(&obj_entry->count, 1); + atomic_set(&obj_entry->mapcount, 1); BUG_ON(set->def_owner < 0 || set->def_owner > KDDM_MAX_DEF_OWNER); @@ -206,7 +206,7 @@ struct kddm_obj *dup_kddm_obj_entry(struct kddm_obj *src_obj) *obj_entry = *src_obj; - atomic_set(&obj_entry->count, 1); + atomic_set(&obj_entry->mapcount, 1); CLEAR_OBJECT_PINNED(obj_entry); atomic_set(&obj_entry->sleeper_count, 0); init_waitqueue_head(&obj_entry->waiting_tsk); @@ -225,7 +225,7 @@ void free_kddm_obj_entry(struct kddm_set *set, objid_t objid) { BUG_ON(object_frozen(obj_entry)); - BUG_ON(obj_entry_count(obj_entry) != 0); + BUG_ON(obj_entry_mapcount(obj_entry) != 0); BUG_ON(is_locked_obj_entry(obj_entry)); BUG_ON(atomic_read(&obj_entry->sleeper_count) != 0); BUG_ON(TEST_OBJECT_PINNED(obj_entry)); @@ -284,7 +284,7 @@ int destroy_kddm_obj_entry (struct kddm_set *set, kddm_unlock_obj_table(set); put_kddm_obj_entry(set, obj_entry, objid); - put_obj_entry_count(set, obj_entry, objid); + dec_obj_entry_mapcount(set, obj_entry, objid); exit: return 0; } @@ -336,7 +336,7 @@ retry: obj_entry = set->ops->get_obj_entry(set, objid, new_obj); if (obj_entry != new_obj) - put_obj_entry_count(set, new_obj, objid); + dec_obj_entry_mapcount(set, new_obj, objid); if (!trylock_obj_entry(obj_entry)) { kddm_unlock_obj_table(set); diff --git a/kerrighed/mm/page_table_tree.c b/kerrighed/mm/page_table_tree.c index 48df900..aec1eee 100644 --- a/kerrighed/mm/page_table_tree.c +++ b/kerrighed/mm/page_table_tree.c @@ -113,8 +113,8 @@ static inline struct kddm_obj *init_swap_pte(struct mm_struct *mm, if (pte_obj_entry(ptep)) { obj_entry = get_obj_entry_from_pte(mm, objid * PAGE_SIZE, ptep, NULL); - atomic_inc(&obj_entry->count); - BUG_ON(obj_entry_count(obj_entry) == 1); + inc_obj_entry_mapcount(obj_entry); + BUG_ON(obj_entry_mapcount(obj_entry) == 1); return _obj_entry; } @@ -168,8 +168,8 @@ static inline struct kddm_obj *init_pte(struct mm_struct *mm, atomic_inc (&page->_kddm_count); if (page->obj_entry != NULL) { struct kddm_obj *obj_entry = page->obj_entry; - atomic_inc(&obj_entry->count); - BUG_ON(obj_entry_count(obj_entry) == 1); + inc_obj_entry_mapcount(obj_entry); + BUG_ON(obj_entry_mapcount(obj_entry) == 1); goto done; } @@ -320,7 +320,7 @@ retry: pte_unmap_unlock(ptep - 1, ptl); if (new_obj) - put_obj_entry_count(set, new_obj, 0); + dec_obj_entry_mapcount(set, new_obj, 0); } static inline void __pt_for_each_pmd(struct kddm_set *set, @@ -604,7 +604,7 @@ struct kddm_obj *kddm_pt_break_cow_object(struct kddm_set *set, return obj_entry; } - BUG_ON(obj_entry_count(obj_entry) == 0); + BUG_ON(obj_entry_mapcount(obj_entry) == 0); BUG_ON(!is_locked_obj_entry(obj_entry)); if (page_kddm_count(old_page) == 1) { @@ -622,10 +622,10 @@ struct kddm_obj *kddm_pt_break_cow_object(struct kddm_set *set, /* Page shared */ atomic_dec(&old_page->_kddm_count); old_page->obj_entry = NULL; - if (obj_entry_count(obj_entry) != 1) { + if (obj_entry_mapcount(obj_entry) != 1) { /* Page shared with another KDDM through the * swap cache. COW the obj entry. */ - atomic_dec(&obj_entry->count); + dec_obj_entry_mapcount(set, obj_entry, objid); new_obj = dup_kddm_obj_entry(obj_entry); unlock_obj_entry(obj_entry); } @@ -641,7 +641,8 @@ struct kddm_obj *kddm_pt_break_cow_object(struct kddm_set *set, else { /* Page shared with another KDDM. COW the obj entry */ BUG_ON(atomic_dec_and_test(&old_page->_kddm_count)); - BUG_ON(atomic_dec_and_test(&obj_entry->count)); + dec_obj_entry_mapcount(set, obj_entry, objid); + BUG_ON(obj_entry_mapcount(obj_entry) == 0); new_obj = dup_kddm_obj_entry(obj_entry); unlock_obj_entry(obj_entry); unlock_kddm_page(old_page); @@ -865,7 +866,7 @@ void kcb_zap_pte(struct mm_struct *mm, unsigned long addr, pte_t *ptep) unlock_kddm_page(page); } - if (atomic_dec_and_test(&obj_entry->count)) { + if (atomic_dec_and_test(&obj_entry->mapcount)) { obj_entry->object = NULL; free_kddm_obj_entry(set, obj_entry, objid); } commit 7bae363f9e4506c0d7250db410060ce0e3ad3f39 Author: Renaud Lottiaux <Ren...@ke...> Date: Thu Sep 9 17:46:18 2010 +0200 [BUGFIX] Fix infinite loop in KDDM workqueue handler. In the case the work queue is full of works which cannot be executed when the handler try to flush them, the works are requeued. If we have a lot of works, the handler can never stop trying to flush the queue. diff --git a/kddm/protocol_action.c b/kddm/protocol_action.c index 9dbfe71..a10b104 100644 --- a/kddm/protocol_action.c +++ b/kddm/protocol_action.c @@ -840,6 +840,8 @@ void kddm_workqueue_handler(struct work_struct *work) action->fn(action->sender, action->data); kfree(action->data); kmem_cache_free(kddm_da_cachep, action); + + cond_resched(); } void flush_kddm_event(struct kddm_set *set, commit 608e96fd4fbf236a5036d167e33f84506dc00bd3 Author: Renaud Lottiaux <Ren...@ke...> Date: Thu Sep 9 17:43:37 2010 +0200 [FEATURE] Add support for node removal in the kddm_set_mgr function. In case the default manager node of a KDDM is removed, the new function will use the nth node as the new manager. diff --git a/include/kddm/kddm_set.h b/include/kddm/kddm_set.h index 5632a6c..35e7c43 100644 --- a/include/kddm/kddm_set.h +++ b/include/kddm/kddm_set.h @@ -17,7 +17,8 @@ #include <kddm/name_space.h> #include <kddm/kddm_tree.h> - +extern krgnodemask_t krgnode_kddm_map; +extern kerrighed_node_t kddm_nb_nodes; /*--------------------------------------------------------------------------* * * @@ -45,7 +46,7 @@ enum /** Return the manager id of the given kddm set */ -#define KDDM_SET_MGR(set) ((kerrighed_node_t)(set->id >> UNIQUE_ID_NODE_SHIFT)) +#define KDDM_SET_MGR(set) __kddm_set_mgr(set, &krgnode_kddm_map, kddm_nb_nodes) #define MAX_PRIVATE_DATA_SIZE (PAGE_SIZE-sizeof(msg_kddm_set_t)) @@ -148,6 +149,9 @@ typedef struct { void kddm_set_init(void); void kddm_set_finalize(void); +kerrighed_node_t __kddm_set_mgr(struct kddm_set * set, + const krgnodemask_t *nodes, int nr_nodes); + struct kddm_set *__create_new_kddm_set(struct kddm_ns *ns, kddm_set_id_t kddm_set_id, struct kddm_set_ops *set_ops, diff --git a/kddm/kddm_hotplug.c b/kddm/kddm_hotplug.c index 082e47d..e83bbb0 100644 --- a/kddm/kddm_hotplug.c +++ b/kddm/kddm_hotplug.c @@ -19,8 +19,6 @@ struct cluster_barrier *kddm_barrier; -extern krgnodemask_t krgnode_kddm_map; -extern kerrighed_node_t kddm_nb_nodes; extern kerrighed_node_t __kddm_io_default_owner (struct kddm_set *set, objid_t objid, const krgnodemask_t *nodes, diff --git a/kddm/kddm_set.c b/kddm/kddm_set.c index 3db81dd..38226c7 100644 --- a/kddm/kddm_set.c +++ b/kddm/kddm_set.c @@ -32,6 +32,19 @@ struct kmem_cache *kddm_set_cachep; extern struct kmem_cache *kddm_tree_cachep; extern struct kmem_cache *kddm_tree_lvl_cachep; +kerrighed_node_t __kddm_set_mgr(struct kddm_set * set, + const krgnodemask_t *nodes, + int nr_nodes) +{ + kerrighed_node_t node; + + node = ((kerrighed_node_t)(set->id >> UNIQUE_ID_NODE_SHIFT)); + if (unlikely(!__krgnode_isset(node, nodes))) + node = __nth_krgnode(node, nodes); + + return node; +} + /** Alloc a new KDDM set id. * @author Renaud Lottiaux * commit aa01aa15edcc4d6d03ff78457c958fa7396696b5 Author: Renaud Lottiaux <Ren...@ke...> Date: Thu Sep 9 17:43:28 2010 +0200 [BUGFIX] Fix deadlock in __pt_for_each_pte. Fix missing wait on the object lock before calling the function pointer. diff --git a/kerrighed/mm/page_table_tree.c b/kerrighed/mm/page_table_tree.c index 81a8d81..48df900 100644 --- a/kerrighed/mm/page_table_tree.c +++ b/kerrighed/mm/page_table_tree.c @@ -289,12 +289,19 @@ static inline void __pt_for_each_pte(struct kddm_set *set, retry: obj_entry = get_obj_entry_from_pte(mm, addr, ptep, NULL); - ret = do_func_on_obj_entry(set, obj_entry, - addr / PAGE_SIZE, f, priv); - if (ret == -EAGAIN) - goto retry; - if (ret == KDDM_OBJ_REMOVED) - pte_clear(mm, addr, ptep); + if (obj_entry) { + if (!trylock_obj_entry(obj_entry)) { + wait_unlock_obj_entry(obj_entry); + goto retry; + } + pte_unmap_unlock(ptep, ptl); + ret = f(addr / PAGE_SIZE, obj_entry, priv); + if (ret == KDDM_OBJ_REMOVED) + pte_clear(mm, addr, ptep); + else + unlock_obj_entry (obj_entry); + ptep = pte_offset_map_lock(mm, pmd, addr, &ptl); + } } else { new_obj = init_pte(mm, ptep, set, addr / PAGE_SIZE, @@ -304,7 +311,7 @@ retry: if (!new_obj) { pte_unmap_unlock(ptep, ptl); new_obj = alloc_kddm_obj_entry(set, 0); - ptep = pte_offset_map_lock(mm, pmd, addr,&ptl); + ptep = pte_offset_map_lock(mm, pmd, addr, &ptl); } } commit 6d13814baa28c0f3413bc73b4b2beee6a9a6969b Author: Renaud Lottiaux <Ren...@ke...> Date: Thu Sep 9 17:38:39 2010 +0200 [ENHANCEMENT] Free KDDM object table levels during a for_each operation if needed. diff --git a/include/kddm/object.h b/include/kddm/object.h index 08323f7..4e19ef5 100644 --- a/include/kddm/object.h +++ b/include/kddm/object.h @@ -85,6 +85,8 @@ typedef enum { #define I_AM_DEFAULT_OWNER(set, objid) \ (kerrighed_node_id == kddm_io_default_owner(set, objid)) +#define KDDM_OBJ_REMOVED 1 + /*--------------------------------------------------------------------------* * * * EXTERN VARIABLES * diff --git a/kddm/kddm_tree.c b/kddm/kddm_tree.c index 2736e80..6b863d0 100644 --- a/kddm/kddm_tree.c +++ b/kddm/kddm_tree.c @@ -214,42 +214,53 @@ static void *kddm_tree_remove(struct kddm_tree *tree, return data; } - - -static void __kddm_tree_for_each_level(struct kddm_set *set, - struct kddm_tree_lvl *cur_level, - int level, - unsigned long index, - int free, - int(*f)(unsigned long, void*, void*), - void *priv) +static int __kddm_tree_for_each_level(struct kddm_set *set, + struct kddm_tree_lvl *cur_level, + int level, + unsigned long index, + int free, + int(*f)(unsigned long, void*, void*), + void *priv) { - int i; + int i, sub_level_freed = 0; struct kddm_tree_lvl *sub_level; struct kddm_tree *tree = set->obj_set; unsigned long index_gap = 1UL << lvl_shift(tree, level); + int res; for (i = 0; i < (1UL << lvl_bits(tree, level)); i++) { retry: sub_level = cur_level->sub_lvl[i]; if (sub_level != NULL) { if ((level + 1) == tree->nr_level) { - if (do_func_on_obj_entry(set, - (struct kddm_obj *)sub_level, - index, f, priv) == -EAGAIN) + res = do_func_on_obj_entry(set, + (struct kddm_obj *)sub_level, + index, f, priv); + if (res == -EAGAIN) goto retry; + sub_level_freed = (res == KDDM_OBJ_REMOVED); } else - __kddm_tree_for_each_level(set, sub_level, - level+1, index, - free, f, priv); + sub_level_freed = + __kddm_tree_for_each_level(set, sub_level, + level+1, index, free, + f, priv); + if (sub_level_freed) { + cur_level->sub_lvl[i] = NULL; + cur_level->nr_obj--; + if (cur_level->nr_obj == 0) + goto free_level; + sub_level_freed = 0; + } } index += index_gap ; } - if (free) { - kfree (cur_level->sub_lvl); - kmem_cache_free(kddm_tree_lvl_cachep, cur_level); - } + if (!free) + return 0; +free_level: + kfree (cur_level->sub_lvl); + kmem_cache_free(kddm_tree_lvl_cachep, cur_level); + return 1; } static inline void __kddm_tree_for_each(struct kddm_set *set, @@ -261,7 +272,8 @@ static inline void __kddm_tree_for_each(struct kddm_set *set, if (tree->lvl1 == NULL) return; - __kddm_tree_for_each_level(set, tree->lvl1, 0, 0, free, f, priv); + if (__kddm_tree_for_each_level(set, tree->lvl1, 0, 0, free, f, priv)) + tree->lvl1 = NULL; } diff --git a/kerrighed/mm/page_table_tree.c b/kerrighed/mm/page_table_tree.c index 99c452b..81a8d81 100644 --- a/kerrighed/mm/page_table_tree.c +++ b/kerrighed/mm/page_table_tree.c @@ -272,6 +272,7 @@ static inline void __pt_for_each_pte(struct kddm_set *set, unsigned long addr; spinlock_t *ptl; pte_t *ptep; + int ret; /* Pre-allocate obj_entry to avoid allocation when holding * mm->page_table_lock (gotten by pte_offset_map_lock). @@ -288,9 +289,12 @@ static inline void __pt_for_each_pte(struct kddm_set *set, retry: obj_entry = get_obj_entry_from_pte(mm, addr, ptep, NULL); - if (do_func_on_obj_entry(set, obj_entry, addr/PAGE_SIZE, - f, priv) == -EAGAIN) + ret = do_func_on_obj_entry(set, obj_entry, + addr / PAGE_SIZE, f, priv); + if (ret == -EAGAIN) goto retry; + if (ret == KDDM_OBJ_REMOVED) + pte_clear(mm, addr, ptep); } else { new_obj = init_pte(mm, ptep, set, addr / PAGE_SIZE, commit 4907e24a4e61263b79f812bb7a70c1bab7578e2a Author: Renaud Lottiaux <Ren...@ke...> Date: Thu Sep 9 17:38:26 2010 +0200 [BUGFIX] The page table scan must be protected by checking the existing VMAs to avoid the scan of trash data. This mainly protect from scanning strange MM space used by /proc/kcore and such things. diff --git a/kerrighed/mm/page_table_tree.c b/kerrighed/mm/page_table_tree.c index 86111a0..99c452b 100644 --- a/kerrighed/mm/page_table_tree.c +++ b/kerrighed/mm/page_table_tree.c @@ -711,11 +711,15 @@ static void kddm_pt_for_each_obj_entry(struct kddm_set *set, void *data) { struct mm_struct *mm = set->obj_set; + struct vm_area_struct *vma; BUG_ON(!f); down_write(&mm->mmap_sem); - kddm_pt_for_each(set, mm, 0, PAGE_OFFSET, f, data); + for (vma = mm->mmap; vma != NULL; vma = vma->vm_next) + if (anon_vma(vma)) + kddm_pt_for_each(set, mm, vma->vm_start, vma->vm_end, + f, data); up_write(&mm->mmap_sem); } commit caa1724797f5a4eca7473cec3046bb4a6802723e Author: Renaud Lottiaux <Ren...@ke...> Date: Thu Sep 9 17:54:30 2010 +0200 [JANITORING] Janitor the KDDM object table and object locking. Since we have introduced a way to write an external object table mechanism, the original table locking is deprecated and can lead to locking issues. The new locking system is based on: - An object lock, implemented as a bit in the object flags field. There is no major changes in this lock. This lock is equivalent to a spinlock. It protects the kddm_obj structure and its corresponding entry in the object table. - A table lock, implemented as a function pointer defined by the object table code. This code is a new one introduced in this patch. The table protection depends on the table and is implemented by the table code designer. This lock protects the table during object operations on the table like add, lookup and remove. - An object frozen flag, implemented as a counter in the object structure. There is no changes in this code. The frozen flag protects the object from some protocol operations (copy on write request, invalidation request, etc). It is mainly used to protect an object between a get or grab and a put. In this new object locking mechanism, we use the frozen flag to avoid any modification of the object table slot: the object cannot be COW or removed from the table. In this new implementation, table operations are now really protected by a locking system defined by the table operations, no more by using the generic KDDM mutexes. The second change is the duration the table lock is taken. For most operations, the lock is just taken during the object lookup, following this scheme: - Object lookup - lock the table - lookup the object in the table - lock the object - unlock the table - Use the object - Unlock the object In some situations, we need to release the object lock (to allow a sleep for instance) but don't want the object to be modified. In this case, we freeze the object and release the lock. Since the object is frozen, only "minor" operations are allowed on the object (local get, some ACK reception, etc). By freezing the object, we are sure the obj_entry structure we have will still be valid without requiering a new table lookup. - Object lookup - lock the table - lookup the object in the table - lock the object - unlock the table - Use the object - freeze the object - Unlock the object - Do might_sleep operation - Lock the object - Unfreeze the object - Continue using the object - Unlock the object Header from folded patch 'KDDM-switch_kddm_tree_mutex_into_spinlocks.patch': [BUGFIX] diff --git a/include/kddm/kddm_find_object.h b/include/kddm/kddm_find_object.h index 7ce84a5..1025ea9 100644 --- a/include/kddm/kddm_find_object.h +++ b/include/kddm/kddm_find_object.h @@ -31,11 +31,11 @@ static inline void *_kddm_find_object_raw (struct kddm_set *set, objid_t objid) struct kddm_obj *obj_entry; void *obj = NULL; - obj_entry = __get_kddm_obj_entry(set, objid); - if (obj_entry) { + kddm_lock_obj_table(set); + obj_entry = set->ops->lookup_obj_entry(set, objid); + kddm_unlock_obj_table(set); + if (obj_entry) obj = obj_entry->object; - put_kddm_obj_entry(set, obj_entry, objid); - } return obj; } diff --git a/include/kddm/kddm_tree.h b/include/kddm/kddm_tree.h index 21f3bdb..31275e4 100644 --- a/include/kddm/kddm_tree.h +++ b/include/kddm/kddm_tree.h @@ -7,6 +7,7 @@ #ifndef __KDDM_TREE__ #define __KDDM_TREE__ +#include <linux/spinlock.h> /*--------------------------------------------------------------------------* @@ -56,6 +57,7 @@ struct kddm_tree_lvl { struct kddm_tree { struct kddm_tree_lvl *lvl1; unsigned long max_data; + spinlock_t table_lock; /**< Object table lock */ int tree_type; int nr_level; int bit_width; /*!< width of index 20, 32, 64 */ diff --git a/include/kddm/kddm_types.h b/include/kddm/kddm_types.h index eb396e2..e2d575e 100644 --- a/include/kddm/kddm_types.h +++ b/include/kddm/kddm_types.h @@ -45,7 +45,9 @@ #define SEND_RM_ACK2 9 /* The default owner need an ack2 after a global remove is done */ #define FAILURE_FLAG 10 +#ifndef CONFIG_DEBUG_SPINLOCK #define OBJECT_LOCKED 11 /* The object is locked */ +#endif /* Object state */ #define STATE_INDEX_MASK 0x000FF000 /* Mask to extract the state index */ @@ -70,7 +72,9 @@ #define TEST_OBJECT_PINNED(obj_entry) \ test_bit (OBJECT_PINNED, &(obj_entry)->flags) +#ifndef CONFIG_DEBUG_SPINLOCK #define SET_OBJECT_LOCKED(obj_entry) \ + BUG_ON(test_bit(OBJECT_LOCKED, &(obj_entry)->flags));\ set_bit(OBJECT_LOCKED, &(obj_entry)->flags) #define TEST_AND_SET_OBJECT_LOCKED(obj_entry) \ test_and_set_bit(OBJECT_LOCKED, &(obj_entry)->flags) @@ -78,6 +82,7 @@ clear_bit(OBJECT_LOCKED, &(obj_entry)->flags) #define TEST_OBJECT_LOCKED(obj_entry) \ test_bit(OBJECT_LOCKED, &(obj_entry)->flags) +#endif #define SET_OBJECT_PENDING(obj_entry) \ set_bit(OBJECT_PENDING_EVENT, &(obj_entry)->flags) @@ -132,7 +137,7 @@ typedef struct { typedef struct kddm_obj { /* flags field must be kept first in the structure */ long flags; /* Flags, state, prob_owner, etc... */ - atomic_t count; /* Reference counter */ + atomic_t count; /* Number of structures sharing the object */ masterObj_t master_obj; /* Object informations handled by the manager */ void *object; /* Kernel physical object struct */ @@ -140,6 +145,9 @@ typedef struct kddm_obj { atomic_t sleeper_count; /* Nunmber of task waiting on the object */ wait_queue_head_t waiting_tsk; /* Process waiting f... [truncated message content] |
From: alebre <al...@us...> - 2010-10-02 12:55:57
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "kdfs". The branch, make_kdfs_compile has been updated via 93feb2aa398019d78a5e95bd501ee47eb82e5031 (commit) via b626068cf8bf47e0c962b6d764d61370d8d83f1c (commit) from c97311254a567ed0ead630ce8f2e681c81c70478 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 93feb2aa398019d78a5e95bd501ee47eb82e5031 Author: ad <leb...@fr...> Date: Sat Oct 2 06:00:40 2010 +0000 Fix implicit striping for meta-data, please note that page management is still unstable diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index 008b62b..79ddff4 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -63,6 +63,17 @@ int kdfs_content_writephyspage(struct content_iolinker_data *content_data, return 0; } +int kdfs_content_readphyspage(struct content_iolinker_data *content_data, + char *page_addr, loff_t pos) +{ + int res = 0; + + kdfs_phys_read(content_data->phys_file, page_addr, PAGE_CACHE_SIZE, &pos); + + PRINT_FUNCTION_EXIT; + return res; +} + /*****************************************************************************/ /* */ /* ADDRESS SPACE OPERATIONS */ @@ -259,7 +270,7 @@ void kdfs_invalidatepage(struct page *page, unsigned long offset) DEBUG(DBG_INFO, "Gonna invalidate page %ld (objid %ld from set %ld)\n", page->index, k_page->obj_id,k_page->set_id); kddm_remove_object(kddm_def_ns, k_page->set_id, k_page->obj_id); - set_page_private(page, NULL); + set_page_private(page, 0); ClearPagePrivate(page); } PRINT_FUNCTION_EXIT; @@ -283,7 +294,7 @@ int kdfs_releasepage(struct page *page, gfp_t mask) /* There is only one copy, so we should exploit remove instead of flush */ kddm_remove_object(kddm_def_ns, k_page->set_id, k_page->obj_id); - set_page_private(page, NULL); + set_page_private(page, 0); ClearPagePrivate(page); PRINT_FUNCTION_EXIT; @@ -374,7 +385,6 @@ struct kdfs_page *kdfs_grab_distpage(struct kdfs_inode *k_inode, pgoff_t page_id return k_newpage; } - struct kdfs_page *kdfs_grab_page(kddm_set_id_t set_id, objid_t obj_id) { @@ -460,71 +470,35 @@ kddm_set_t *__create_content_kddm_set(kddm_set_id_t set_id, return kddm_set; } -int __kddm_set_local_destroy(int nsid, int setid) -{ - struct kddm_ns *ns; - struct kddm_set *kddm_set; - - /* Remove the kddm set from the name space */ - ns = kddm_ns_get (nsid); - if (ns == NULL) - return -EINVAL; - - kddm_set = hashtable_remove(ns->kddm_set_table, setid); - kddm_ns_put (ns); - - if (kddm_set == NULL) - return -EINVAL; - - put_kddm_set(kddm_set); - return 0; -} +/*****************************************************************************/ +/* */ +/* ADDRESS IO LINKER PART */ +/* (exploited for dir and file io-linkers) */ +/* (Latest code verification - April, 2010 - Adrien) */ +/*****************************************************************************/ /* - * Destroy the local instance of a content kddm_set (internal function) - * @author Adrien Lebre + * Determine the owner for a particular page. + * If the page has not been yet allocated, the page will be stored locally. + * @author Adrien Lebre * - * @param k_inode Inode associated with this 'content' set - * @return O if everything was ok + * @param kddm_set Container descriptor + * @param objid inode Id. */ -int __local_destroy_content_kddm_set(struct kdfs_inode *k_inode) +kerrighed_node_t kdfs_iol_page_default_owner (kddm_set_t *kddm_set, + objid_t objid, + const krgnodemask_t *nodes, + int nr_nodes) { - kddm_set_t *kddm_set = NULL; - - PRINT_FUNCTION_NAME; - - kddm_set = _local_get_kddm_set(kddm_def_ns, k_inode->content_setid); - if (!kddm_set) - DEBUG(DBG_INFO, "The associated kddm_set for inode %ld hasn't been instantiated\n", k_inode->inode->i_ino); - else{ - /* - * TODO PRIORITY 1, Adrien / (Renaud kDDM stuff) - * According to the function __handle_req_kddm_set_destroy - * http://lxr.kerlabs.com/kerrighed/source/modules/ctnr/kddm_set.c#650 - * I have to first remove the set from the local namespace and then - * free the kddm_set struct. - * Currently, I implemented the following function - * which is approximately a copy/paste of the __handle_req_kddm_set_destroy - * function. - */ - __kddm_set_local_destroy(KDDM_DEF_NS_ID, k_inode->content_setid); - - /* - * Free the kddm set structure (second call, count will reach 0 - * and the set structure will be freed) - */ - put_kddm_set(kddm_set); - } - PRINT_FUNCTION_EXIT; - return 0; + kerrighed_node_t ret_val; + + // check who's the default owner of the object !!! + ret_val = page_linked_node(objid); + + DEBUG(DBG_DBG, "######### /\\/\\/\\/ page owner ::: %d\n", ret_val); + return ret_val; } -/*****************************************************************************/ -/* */ -/* ADDRESS IO LINKER PART */ -/* (exploited for dir and file io-linkers) */ -/* (Latest code verification - April, 2010 - Adrien) */ -/*****************************************************************************/ /* * Allocate a kdfs_page object @@ -776,7 +750,7 @@ int kdfs_iol_page_invalidate(kddm_obj_t *objEntry, kddm_set_t *set, trylock_page(k_page->page); remove_from_page_cache(k_page->page); - set_page_private(page, NULL); + set_page_private(k_page->page, 0); ClearPagePrivate(k_page->page); unlock_page(k_page->page); page_cache_release(k_page->page); @@ -878,7 +852,7 @@ int kdfs_iol_page_put(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid) } /* - * I/O linker function called when a page is removed + * I/O linker function called when a page is remove from the cache * @author Pierre Riteau * * @param objEntry page to remove @@ -919,7 +893,7 @@ int kdfs_iol_page_remove(void *object, struct kddm_set *set, objid_t objid) * * @return error code or 0 if everything was ok. */ -int content_instantiate(kddm_set_t *kddm_set, void *private_data, int master) +int kdfs_iol_content_instantiate(kddm_set_t *kddm_set, void *private_data, int master) { struct content_iolinker_data *content_data = NULL; struct inode *inode = NULL; @@ -982,17 +956,12 @@ int content_instantiate(kddm_set_t *kddm_set, void *private_data, int master) content_data->phys_file = NULL; } - /* TODO PRIORITY 2, Adrien, we could have some issue if the kernel tries to remove the inode during this code */ /* Retrieve the local ref to the k_mapping object */ inode = ilookup(k_sb->sb, content_data->ino); if (inode) { DEBUG(DBG_INFO, "K_mapping from the cache\n"); content_data->k_mapping = inode->i_mapping; iput(inode); - } else if (inode_linked_node(content_data->ino) == kerrighed_node_id){ - DEBUG(DBG_PANIC, "K_mapping will be retrieve from iget, however this should not occur\n"); -// inode = kdfs_getinode(k_sb->sb, content_data->ino); - content_data->k_mapping = inode->i_mapping; } else { /* do dummy stuff */ DEBUG(DBG_INFO, "K_mapping exploits a dummy inode\n"); @@ -1016,31 +985,24 @@ int content_instantiate(kddm_set_t *kddm_set, void *private_data, int master) * * @param kddm_set kddm_set to uninstantiate */ -void content_uninstantiate(kddm_set_t *kddm_set, int destroy) +void kdfs_iol_content_uninstantiate(kddm_set_t *kddm_set, int destroy) { struct content_iolinker_data *content_data; - PRINT_FUNCTION_NAME; ASSERT(kddm_set != NULL); ASSERT(kddm_set->private_data != NULL); content_data = (struct content_iolinker_data *) kddm_set->private_data; - if (content_data->phys_dirname != NULL) - kfree(content_data->phys_dirname); + if (content_data->phys_dirname != NULL) { + DEBUG (DBG_TRACE, "uninstantiate content kddm_set link to inode %ld (physical file:%s)", + content_data->ino,content_data->phys_dirname); + kfree(content_data->phys_dirname); + } if (content_data->phys_file != NULL) close_phys_file(content_data->phys_file); PRINT_FUNCTION_EXIT; } -int kdfs_content_readphyspage(struct content_iolinker_data *content_data, - char *page_addr, loff_t pos) -{ - int res = 0; - - kdfs_phys_read(content_data->phys_file, page_addr, PAGE_CACHE_SIZE, &pos); - PRINT_FUNCTION_EXIT; - return res; -} diff --git a/fs/kdfs/address_space.h b/fs/kdfs/address_space.h index fd06436..ccc332a 100644 --- a/fs/kdfs/address_space.h +++ b/fs/kdfs/address_space.h @@ -135,6 +135,7 @@ void __kdfs_put_page(kddm_set_id_t set_id, objid_t obj_id); void kdfs_distmark_page_dirty(struct kdfs_inode *k_inode, pgoff_t page_id); void kdfs_mark_page_dirty(kddm_set_id_t set_id, objid_t obj_id); +kerrighed_node_t kdfs_iol_page_default_owner (kddm_set_t *kddm_set, objid_t objid, const krgnodemask_t *nodes, int nr_nodes); int kdfs_iol_page_alloc(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid); int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid, int flags); int kdfs_iol_page_insert(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid); @@ -144,14 +145,14 @@ int kdfs_iol_page_import (struct rpc_desc *desc, struct kddm_set *set, struct kd int kdfs_iol_page_sync(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid); int kdfs_iol_page_put(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid); int kdfs_iol_page_remove(void *object, struct kddm_set *set, objid_t objid); + kddm_set_t *__create_content_kddm_set(kddm_set_id_t set_id, kerrighed_node_t linked_node, struct kdfs_inode *k_inode, iolinker_id_t type); -int __local_destroy_content_kddm_set(struct kdfs_inode *k_inode); -int content_instantiate(kddm_set_t *kddm_set, void *private_data, int master); -void content_uninstantiate(kddm_set_t *kddm_set, int destroy); +int kdfs_iol_content_instantiate(kddm_set_t *kddm_set, void *private_data, int master); +void kdfs_iol_content_uninstantiate(kddm_set_t *kddm_set, int destroy); /*--------------------------------------------------------------------------* * * diff --git a/fs/kdfs/dir.c b/fs/kdfs/dir.c index c0d0e0b..b378577 100644 --- a/fs/kdfs/dir.c +++ b/fs/kdfs/dir.c @@ -778,8 +778,9 @@ kddm_set_t *create_dir_kddm_set(struct kdfs_inode *dir) ASSERT(dir != NULL); ASSERT(dir->inode != NULL); - - kddm_set = __create_content_kddm_set(0, inode_linked_node(dir->inode->i_ino), dir, DIR_LINKER); +// Enable distributed directory management - Adrien +// kddm_set = __create_content_kddm_set(0, inode_linked_node(dir->inode->i_ino), dir, DIR_LINKER); + kddm_set = __create_content_kddm_set(0, KDDM_CUSTOM_DEF_OWNER, dir, DIR_LINKER); if (!IS_ERR(kddm_set)) { dir->content_setid = kddm_set->id; DEBUG(DBG_TRACE, @@ -811,24 +812,15 @@ kddm_set_t *create_dir_kddm_set(struct kdfs_inode *dir) */ int dir_instantiate (kddm_set_t *kddm_set, void *private_data, int master) { - return content_instantiate(kddm_set, private_data, master); -} - -/* - * Uninstantiate a directory container. - * @author Adrien Lebre - * - * @param kddm_set kddm_set to uninstantiate - * @param destroy ??? - */ -void dir_uninstantiate (kddm_set_t *kddm_set, int destroy) -{ - content_uninstantiate(kddm_set, destroy); + return kdfs_iol_content_instantiate(kddm_set, private_data, master); } /* Init the dir IO linker */ struct iolinker_struct dir_io_linker = { .alloc_object = kdfs_iol_page_alloc, +#if KDFS_FILE_STRIPING + .default_owner = kdfs_iol_page_default_owner, +#endif .export_object = kdfs_iol_page_export, .first_touch = kdfs_iol_page_first_touch, .import_object = kdfs_iol_page_import, @@ -840,5 +832,5 @@ struct iolinker_struct dir_io_linker = { // .put_object = kdfs_iol_page_put, .remove_object = kdfs_iol_page_remove, .sync_object = kdfs_iol_page_sync, - .uninstantiate = dir_uninstantiate, + .uninstantiate = kdfs_iol_content_uninstantiate, }; diff --git a/fs/kdfs/file.c b/fs/kdfs/file.c index 1fe9e23..4f6b131 100644 --- a/fs/kdfs/file.c +++ b/fs/kdfs/file.c @@ -250,28 +250,6 @@ kddm_set_t *create_file_kddm_set(struct kdfs_inode *k_inode) /*****************************************************************************/ /* - * Determine the owner for a particular page. - * If the page has not been yet allocated, the page will be stored locally. - * @author Adrien Lebre - * - * @param kddm_set Container descriptor - * @param objid inode Id. - */ -kerrighed_node_t kdfs_iol_file_default_owner (kddm_set_t *kddm_set, - objid_t objid, - const krgnodemask_t *nodes, - int nr_nodes) -{ - kerrighed_node_t ret_val; - - // check who's the default owner of the object !!! - ret_val = page_linked_node(objid); - - DEBUG(DBG_DBG, "######### /\\/\\/\\/ page owner ::: %d\n", ret_val); - return ret_val; -} - -/* * Instantiate a container with a file linker. * @author Adrien Lebre * @@ -282,24 +260,14 @@ kerrighed_node_t kdfs_iol_file_default_owner (kddm_set_t *kddm_set, */ int kdfs_iol_file_instantiate (kddm_set_t *kddm_set, void *private_data, int master) { - return content_instantiate(kddm_set, private_data, master); -} - -/** Uninstantiate a file container. - * @author Adrien Lebre - * - * @param kddm_set kddm_set to uninstantiate - */ -void kdfs_iol_file_uninstantiate (kddm_set_t *kddm_set, int destroy) -{ - content_uninstantiate(kddm_set, destroy); + return kdfs_iol_content_instantiate(kddm_set, private_data, master); } /* Init the file I/O linker */ struct iolinker_struct file_io_linker = { .alloc_object = kdfs_iol_page_alloc, #if KDFS_FILE_STRIPING - .default_owner = kdfs_iol_file_default_owner, + .default_owner = kdfs_iol_page_default_owner, #endif .export_object = kdfs_iol_page_export, .first_touch = kdfs_iol_page_first_touch, @@ -312,5 +280,5 @@ struct iolinker_struct file_io_linker = { // .put_object = kdfs_iol_page_put, .remove_object = kdfs_iol_page_remove, .sync_object = kdfs_iol_page_sync, - .uninstantiate = kdfs_iol_file_uninstantiate, + .uninstantiate = kdfs_iol_content_uninstantiate, }; diff --git a/fs/kdfs/file_extent.c b/fs/kdfs/file_extent.c index ae9f811..f3c0279 100644 --- a/fs/kdfs/file_extent.c +++ b/fs/kdfs/file_extent.c @@ -19,11 +19,24 @@ void kdfs_file_extent_init(struct kdfs_inode *k_inode) { - DEBUG(DBG_INFO, "INIT LIST\n"); + DEBUG(DBG_TRACE, "INIT LIST\n"); /* initialise the extents list */ INIT_LIST_HEAD(&k_inode->extents_list); } +void kdfs_file_extent_free(struct kdfs_inode *k_inode){ + struct kdfs_file_extent *curr, *next; + + DEBUG(DBG_TRACE, "FREE LIST\n"); + + if (!list_empty(&k_inode->extents_list)) { + list_for_each_entry_safe(curr,next, &k_inode->extents_list, list_item) { + kfree(curr); + } + } +} + + struct kdfs_file_extent *kdfs_file_extent_alloc(pgoff_t page_start, pgoff_t page_end, kdfs_node_t owner_id) { struct kdfs_file_extent *extent; diff --git a/fs/kdfs/file_extent.h b/fs/kdfs/file_extent.h index 6b2ea31..c55e5e8 100644 --- a/fs/kdfs/file_extent.h +++ b/fs/kdfs/file_extent.h @@ -17,6 +17,8 @@ void kdfs_file_extent_init(struct kdfs_inode *k_inode); +void kdfs_file_extent_free(struct kdfs_inode *k_inode); + struct kdfs_file_extent *kdfs_file_extent_alloc(pgoff_t page_start, pgoff_t page_end, kdfs_node_t owner_id); int kdfs_file_extent_find(struct list_head *extents, pgoff_t page_no, struct kdfs_file_extent **ext_before, struct kdfs_file_extent **ext_in, struct kdfs_file_extent **ext_after); diff --git a/fs/kdfs/inode.c b/fs/kdfs/inode.c index 18d557e..c1e21dd 100644 --- a/fs/kdfs/inode.c +++ b/fs/kdfs/inode.c @@ -961,31 +961,17 @@ struct kdfs_inode *kdfs_ilocalfind(unsigned long ino) } /* - * Flush the object somewhere else in the cluster or remove + * Flush the object locally or remove * the object from the kddm set if this is the last copy. */ void kdfs_idrop(unsigned long ino) { - kddm_obj_t *obj_entry; - PRINT_FUNCTION_NAME; - /* - * TODO NOW: Adrien & Pierre - * This test maybe should be done before, in super.c - * Check if the object is locked or not (from kddm point of view) - */ - - obj_entry = __get_kddm_obj_entry(kdfs_inode_kddm, ino); - if (OBJ_EXCLUSIVE2(COPYSET(obj_entry))) { - put_kddm_obj_entry(kdfs_inode_kddm, obj_entry, ino); - kddm_remove_frozen_object(kddm_def_ns, KDFS_INODE_KDDM_ID, ino); - } - else { - put_kddm_obj_entry(kdfs_inode_kddm, obj_entry, ino); - kddm_flush_object(kddm_def_ns, KDFS_INODE_KDDM_ID, ino, KERRIGHED_NODE_ID_NONE); - } - + if(kddm_flush_object(kddm_def_ns, KDFS_INODE_KDDM_ID, ino, KERRIGHED_NODE_ID_NONE) == -ENOSPC) + /* There is only one copy, so we should exploit remove instead of flush */ + kddm_remove_object(kddm_def_ns,KDFS_INODE_KDDM_ID, ino); + PRINT_FUNCTION_EXIT; } @@ -1026,7 +1012,6 @@ kerrighed_node_t kdfs_iol_inode_default_owner(kddm_set_t *kddm_set, objid_t obji /* * Allocate an object - * @author Renaud Lottiaux */ int kdfs_iol_inode_alloc_object (kddm_obj_t *objEntry, kddm_set_t *kddm_set, @@ -1066,7 +1051,7 @@ int kdfs_iol_inode_alloc_object (kddm_obj_t *objEntry, else { k_inode->inode = new_inode(k_sb->sb); k_inode->inode->i_ino = objid; - insert_inode_hash(k_inode->inode); +// insert_inode_hash(k_inode->inode); } k_inode->flags = K_INODE_INITIALIZING; @@ -1080,25 +1065,8 @@ int kdfs_iol_inode_alloc_object (kddm_obj_t *objEntry, } else { /* Object id has been already allocated so reused the same structure */ DEBUG(DBG_PANIC, "Object %ld was already allocated \n", objid); - //kdfs_inode = (struct kdfs_inode*) objEntry->object; // seems to be useless since we do not have to return the object } - /* TODO PRIORITY 3: Adrien - * interest of the following code inside the alloc function - */ -// if (inode_linked_node(objid) == kerrighed_node_id) { -// char *phys_dirname; -// /* Find the physical path corresponding to the KDFS inode */ -// phys_dirname = kmalloc(PATH_MAX, GFP_KERNEL); -// ASSERT(phys_dirname != NULL); -// -// kdfs_getphysicalpath(k_sb, objid, phys_dirname); -// if (check_create_phys_dir(phys_dirname, 0777, 0, 0) != 0) -// BUG(); -// -// kfree(phys_dirname); -// } -// __kdfs_twice_putsb(k_sb); PRINT_FUNCTION_EXIT; return 0; @@ -1143,12 +1111,15 @@ int kdfs_iol_inode_first_touch(kddm_obj_t *objEntry, */ // Case 1: it's a new file, so a new inode if (flags & KDDM_CREATE_ON_FT) { + // new_inode allocates a new inode and adds it into the list of + // used inodes for the related superblock + // Adding the inode into the local inode cache is done later into the kddm_iol_insert function k_inode->inode = new_inode (k_sb->sb); k_inode->flags = K_INODE_CREATING|K_INODE_INITIALIZING; if (k_inode->inode == NULL) DEBUG(DBG_PANIC, "Cannot find inode %ld\n", objid); k_inode->inode->i_ino = objid; - insert_inode_hash(k_inode->inode); + // insert_inode_hash(k_inode->inode); } // Case 2: the inode already exists, so fill it from the HDD else { @@ -1161,24 +1132,81 @@ int kdfs_iol_inode_first_touch(kddm_obj_t *objEntry, objEntry->object = (void *) k_inode; DEBUG(DBG_INFO, "inode count %d\n", atomic_read(&k_inode->inode->i_count)); -// if (inode_linked_node(objid) == kerrighed_node_id) { -// char *phys_dirname; -// /* Find the physical path corresponding to the KDFS inode */ -// phys_dirname = kmalloc(PATH_MAX, GFP_KERNEL); -// ASSERT(phys_dirname != NULL); -// -// kdfs_getphysicalpath(k_sb, objid, phys_dirname); -// if (check_create_phys_dir(phys_dirname, 0777, 0, 0) != 0) -// BUG(); -// kfree(phys_dirname); -// - __kdfs_twice_putsb(k_sb); PRINT_FUNCTION_EXIT; return 0; } /* + * Insert a copy of an inode. Update the inode struct. + * @author Adrien Lebre + * + * @param objEntry descriptor of the k_inode to insert. + * @param set kddm set descriptor + * @param objid Id of the k_inode object to insert. + */ +int kdfs_iol_inode_insert_object(kddm_obj_t *objEntry, + kddm_set_t *set, + objid_t objid) +{ + struct kdfs_inode *k_inode = (struct kdfs_inode *) objEntry->object; + + DEBUG(DBG_INFO, "Insert inode (%ld;%ld)\n", set->id, objid); + + /* + * If this is the first insert in the set (just called after the first_touch) + * k_inode->inode->i_mode has not been yet assigned. So we cannot assign the + * right references for the operations + */ + if (!(k_inode->flags & K_INODE_CREATING)) { + /* According to the mode, set the right operations */ + switch (k_inode->inode->i_mode & S_IFMT) { + case S_IFREG: + DEBUG(DBG_TRACE, "Set file operations %o\n", k_inode->inode->i_mode & S_IFMT); + k_inode->inode->i_op = &kdfs_file_inode_operations; + k_inode->inode->i_fop = &kdfs_file_fops; + k_inode->inode->i_mapping->a_ops = &kdfs_aops; + break; + case S_IFDIR: + DEBUG (DBG_TRACE, "Set dir operations %o\n", k_inode->inode->i_mode & S_IFMT); + k_inode->inode->i_op = &kdfs_dir_inode_operations; + k_inode->inode->i_fop = &kdfs_dir_fops; + k_inode->inode->i_mapping->a_ops = &kdfs_aops; + break; + case S_IFLNK: + k_inode->inode->i_op = &kdfs_symlink_inode_operations; + k_inode->inode->i_mapping->a_ops = &kdfs_aops; + break; + case S_IFBLK: + case S_IFCHR: + case S_IFIFO: + case S_IFSOCK: + init_special_inode(k_inode->inode, k_inode->inode->i_mode, k_inode->inode->i_sb->s_dev); + break; + default: + DEBUG(DBG_PANIC, + "Cannot set kdfs inode operations %o (ino %ld)\n", + k_inode->inode->i_mode & S_IFMT, k_inode->inode->i_ino); + DEBUG(DBG_PANIC, "filename %s\n", + list_entry(k_inode->inode->i_dentry.next, struct dentry, d_alias)->d_name.name); + break; + } + } + k_inode->inode->i_flags |= S_NOATIME; + insert_inode_hash(k_inode->inode); + PRINT_FUNCTION_EXIT; + return 0; + + /* TODO PRIORITY 1, Adrien: + * A bug can occur for the case where a remote node access to one object for the first time (get) + * This object is then inserted in the local set without setting its right reference according to its mode.... + * Is it possible ? + */ +} + + + +/* * Export an object * * @author Adrien Lebre @@ -1199,6 +1227,8 @@ int kdfs_iol_inode_export_object(struct rpc_desc *desc, int res = 0; PRINT_FUNCTION_NAME; + + /* export the inode part*/ kdfs_export_kdfs_inode(&net_dest, src); /* export the extents part */ @@ -1230,6 +1260,8 @@ int kdfs_iol_inode_import_object(struct rpc_desc *desc, PRINT_FUNCTION_NAME; res = rpc_unpack_type(desc, net_src); + + /* import the inode part*/ kdfs_import_kdfs_inode(inode_dst, &net_src); /* import the extents part */ @@ -1279,73 +1311,6 @@ int kdfs_iol_inode_invalidate_object(kddm_obj_t *objEntry, PRINT_FUNCTION_EXIT; return KDDM_IO_KEEP_OBJECT; // in order to keep the object } - -/* - * Receive a fresh copy of an inode. Update the inode struct. - * @author Adrien Lebre - * - * @param objEntry descriptor of the k_inode to insert. - * @param set kddm set descriptor - * @param objid Id of the k_inode object to insert. - */ -int kdfs_iol_inode_insert_object(kddm_obj_t *objEntry, - kddm_set_t *set, - objid_t objid) -{ - struct kdfs_inode *k_inode = (struct kdfs_inode *) objEntry->object; - - DEBUG(DBG_INFO, "Insert inode (%ld;%ld)\n", set->id, objid); - - /* - * If this is the first insert in the set (just called after the first_touch) - * k_inode->inode->i_mode has not been yet assigned. So we cannot assign the - * right references for the operations - */ - if (!(k_inode->flags & K_INODE_CREATING)) { - /* According to the mode, set the right operations */ - switch (k_inode->inode->i_mode & S_IFMT) { - case S_IFREG: - DEBUG(DBG_TRACE, "Set file operations %o\n", k_inode->inode->i_mode & S_IFMT); - k_inode->inode->i_op = &kdfs_file_inode_operations; - k_inode->inode->i_fop = &kdfs_file_fops; - k_inode->inode->i_mapping->a_ops = &kdfs_aops; - break; - case S_IFDIR: - DEBUG (DBG_TRACE, "Set dir operations %o\n", k_inode->inode->i_mode & S_IFMT); - k_inode->inode->i_op = &kdfs_dir_inode_operations; - k_inode->inode->i_fop = &kdfs_dir_fops; - k_inode->inode->i_mapping->a_ops = &kdfs_aops; - break; - case S_IFLNK: - k_inode->inode->i_op = &kdfs_symlink_inode_operations; - k_inode->inode->i_mapping->a_ops = &kdfs_aops; - break; - case S_IFBLK: - case S_IFCHR: - case S_IFIFO: - case S_IFSOCK: - init_special_inode(k_inode->inode, k_inode->inode->i_mode, k_inode->inode->i_sb->s_dev); - break; - default: - DEBUG(DBG_PANIC, - "Cannot set kdfs inode operations %o (ino %ld)\n", - k_inode->inode->i_mode & S_IFMT, k_inode->inode->i_ino); - DEBUG(DBG_PANIC, "filename %s\n", - list_entry(k_inode->inode->i_dentry.next, struct dentry, d_alias)->d_name.name); - break; - } - } - k_inode->inode->i_flags |= S_NOATIME; - PRINT_FUNCTION_EXIT; - return 0; - - /* TODO PRIORITY 1, Adrien: - * A bug can occur for the case where a remote node access to one object for the first time (get) - * This object is then inserted in the local set without setting its right reference according to its mode.... - * Is it possible ? - */ -} - /* * Sync an inode struct (mark at dirty on the right node). * @author Adrien Lebre @@ -1379,37 +1344,9 @@ int kdfs_iol_inode_sync_object(kddm_obj_t *objEntry, int kdfs_iol_inode_remove_object(void *object, kddm_set_t *set, objid_t objid) { struct kdfs_inode *k_inode = (struct kdfs_inode *)object; - struct kddm_set *associated_set; - /* - * We are on the object linked node and the inode has to be deleted; - * otherwise, it's just a kddm_flush_object which should - * only remove the inode information from the local cache. - */ - if ((inode_linked_node(objid) == kerrighed_node_id) && (k_inode->flags & K_INODE_TODELETE)) { - /* Destroy locally */ - ASSERT(k_inode->inode->i_nlink == 0); - DEBUG(DBG_INFO, "We are on the linked node and the file has to be deleted\n"); - /* Actually file is currently deleted in the super.c: kdfs_delete_inode */ - kfree(object); - } - else { - /* Set associated content set reference to null */ - if (k_inode->content_setid != KDDM_SET_UNUSED) { - associated_set = _local_get_kddm_set(kddm_def_ns, k_inode->content_setid); - if (associated_set) { - //TODO NOW: Should we destroy? -#if 0 - put_associated_set(kddm_set); - DEBUG (DBG_INFO,"\n\n\n\n REMOVE KDDM SET\n\n\n"); - _destroy_associated_set(kddm_set); - kdfs_inode->content_setid = KDDM_SET_UNUSED; -#endif - ((struct content_iolinker_data *) associated_set->private_data)->k_mapping = NULL; - put_kddm_set(associated_set); - } - } - kfree(object); - } + // Free memory previously allocated. + kdfs_file_extent_free(k_inode); + kfree(k_inode); return 0; } diff --git a/fs/kdfs/physical_fs.c b/fs/kdfs/physical_fs.c index 05c0302..66b65e9 100644 --- a/fs/kdfs/physical_fs.c +++ b/fs/kdfs/physical_fs.c @@ -13,6 +13,7 @@ #include <asm/ia32.h> #endif +#include <linux/file.h> #include <asm/uaccess.h> #include <linux/namei.h> #include <linux/fs_struct.h> @@ -144,6 +145,8 @@ long remove_phys_dir(const char *pathname, uid_t uid, gid_t gid) dentry = file->f_dentry; dir = dentry->d_parent->d_inode; + filp_close(file,current->files); + DEBUG(DBG_INFO, "Remove dir %s from dir %s\n", dentry->d_name.name, dentry->d_parent->d_name.name); @@ -154,9 +157,9 @@ long remove_phys_dir(const char *pathname, uid_t uid, gid_t gid) dentry->d_parent->d_name.name); // TODO PRIORITY 3, Adrien Usefull / Useless ? - //dput(dentry); - // put_filp(file); - filp_close(file,current->files); + // Check Renaud code from kerrighed/fs/physical_fs.c + dput(dentry); + put_filp(file); out: __revert_old_creds(overridden_creds, old_creds); @@ -412,7 +415,7 @@ int kdfs_phys_write(struct file *file, char *addr, size_t len, loff_t *pos) int ret; mm_segment_t old_fs; - DEBUG(DBG_INFO, "Write Native file %s to position %ld (size %ld)\n", file->f_dentry->d_name.name, *pos, len); + DEBUG(DBG_INFO, "Write Native file %s to position %lld (size %ld )\n", file->f_dentry->d_name.name, *pos, len); old_fs = get_fs(); set_fs(KERNEL_DS); /* Enable to read in kernel memory */ @@ -465,15 +468,18 @@ int remove_phys_file(const char *filename, uid_t uid, gid_t gid) dir = dentry->d_parent->d_inode; filp_close(file,current->files); - // TODO PRIORITY 3, Adrien Useful / Useless ? - //dput(dentry); - // put_filp(file); DEBUG(DBG_INFO, "Remove file %s from dir %s\n", dentry->d_name.name, dentry->d_parent->d_name.name); res = vfs_unlink(dir, dentry); + // TODO PRIORITY 3, Adrien Useful / Useless ? + // Check Renaud code from kerrighed/fs/physical_fs.c + dput(dentry); + put_filp(file); + + DEBUG(DBG_INFO, "After vfs_unlink res = %d\n", res); diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index cb5d069..0314574 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -9,6 +9,7 @@ * @maintainer Adrien Lebre * * Copyright (C) 2006-2007, XtreemOS Consortium. + * Copyright (C) 2008-20xx, Mines Nantes - INRIA Rennes Bretagne Atlantique - LINA . */ #include <linux/module.h> @@ -333,6 +334,7 @@ void kdfs_remove_local_ino(struct kdfs_super_block *k_sb, unsigned long ino) kdfs_getphysicalpath(k_sb, ino, phys_dirname); sprintf(phys_dirname, "%s/" KDFS_CONTENT_FILENAME, phys_dirname); DEBUG(DBG_INFO, "Try to remove phys_file %s\n", phys_dirname); +// UNE LIGNE IMPORTANTE QUI POSE UN PROBLEME PUISQU'IL EN DECOULE une inode a null et donc un fichier qui ne pourra etre fermé proprement dans kdfs_iol_content_uninstantiate remove_phys_file(phys_dirname, 0, 0); #if 0 @@ -1100,7 +1102,7 @@ int __kdfs_write_inode(struct kdfs_inode *k_inode) /* * Drop a kdfs inode from the inode cache * This function is called by the VFS when someone calls iput_final() - * + * (i.e. when the i_count equals 0) * @author Adrien Lebre * * @param inode The VFS inode @@ -1108,23 +1110,21 @@ int __kdfs_write_inode(struct kdfs_inode *k_inode) */ void kdfs_drop_inode(struct inode *inode) { - struct kdfs_inode *k_inode = NULL; - DEBUG(DBG_INFO, "inode id %ld\n", inode->i_ino); + long ino = inode->i_ino; + DEBUG(DBG_INFO, "inode id %ld\n", ino); if (inode->i_nlink) { - /* Generic forget is unfortunately not exported */ - //generic_forget_inode(inode); - - /* TODO PRIORITY 1, Adrien: - * Take care about inode memory desallocation */ + /* Generic forget is unfortunately not exported unfortunately */ + /* so we have to call generic_drop_inode */ generic_drop_inode(inode); - - k_inode = kdfs_igrab(inode->i_ino); - /* Associated kddm desallocation */ - // ICI - //__local_destroy_content_kddm_set(k_inode); - - kdfs_idrop(inode->i_ino); + + // We should not remove a kDDM set locally (it can break for instance the chain owner) + // You should flush all objects and wait to remove the remaining data when someone + // is going to call kdddm_remove + // The flush of all objects is done through the truncate_inode_pages called by generic_drop_inode + + kdfs_idrop(ino); + } else generic_delete_inode(inode); @@ -1132,10 +1132,7 @@ void kdfs_drop_inode(struct inode *inode) } /* - * TODO NOW: Adrien Pierre, - * Cf. inode.c line 954. - * kdfs_idrop should be called when we want to flush an object and ONLY for a flush - * otherwise, we should call kdfs_idelete. + * WARNINGS: * Currently, there is a STRONG issue: kdfs_idelete is call whatever the i_count value * on other nodes. * The basic idea consists in adding some check in order to know if we are the last node @@ -1151,39 +1148,23 @@ void kdfs_delete_inode(struct inode *inode) * In other words, only the last node which is using this inode, has * to delete it. */ - struct kdfs_inode *kdfs_inode = NULL; - struct kddm_set *kddm_set = NULL; + struct kdfs_inode *k_inode = NULL; struct kdfs_super_block *k_sb = NULL; - struct file *phys_file = NULL; - - ASSERT(inode != NULL); + DEBUG(DBG_INFO, "Delete Inode %ld\n", inode->i_ino); k_sb = kdfs_getsb(kerrighed_node_id); -#if 0 - if ( kdfs_node_isowner(inode->i_inod) { - k_inode->flags|=K_INODE_TODELETE; - /* destroy the object with a flush */ - - } - elseif (k_inode->flags & K_INODE_TODELETE)) - /* I need to really destroy the on-disk object */ -#endif /* Get the inode and delete its associated content set and its entry in INODE KDDM Set */ - kdfs_inode = kdfs_igrab(inode->i_ino); + k_inode = kdfs_iget(inode->i_ino); + + // TODO check whether this is previously called by the vfs layer ? truncate_inode_pages(&inode->i_data, 0); - if (kdfs_inode->content_setid != KDDM_SET_UNUSED) { - kddm_set = _local_get_kddm_set(kddm_def_ns, kdfs_inode->content_setid); - //kddm_set = _find_get_kddm_set(kddm_def_ns,kdfs_inode->content_setid); - if (kddm_set) { - phys_file = ((struct content_iolinker_data *) kddm_set->private_data)->phys_file; - ((struct content_iolinker_data *) kddm_set->private_data)->phys_file = NULL; - put_kddm_set(kddm_set); - DEBUG (DBG_INFO,"\n\n\n\n REMOVE KDDM SET\n\n\n"); - _destroy_kddm_set(kddm_set); - kdfs_inode->content_setid = KDDM_SET_UNUSED; + +// ICI + if (k_inode->content_setid != KDDM_SET_UNUSED) { + destroy_kddm_set(kddm_def_ns, k_inode->content_setid); + k_inode->content_setid = KDDM_SET_UNUSED; } - } /* Cleanly remove inode from kddm inode set */ kdfs_idelete(inode->i_ino); // equivalent to kdfs_iput() and remove @@ -1192,8 +1173,6 @@ void kdfs_delete_inode(struct inode *inode) if (inode_linked_node(inode->i_ino) == kerrighed_node_id) { /* Close the physical file before it is removed in kdfs_remove_local_ino */ - if (phys_file != NULL) - close_phys_file(phys_file); kdfs_remove_local_ino(k_sb, inode->i_ino); } commit b626068cf8bf47e0c962b6d764d61370d8d83f1c Author: ad <leb...@fr...> Date: Fri Aug 20 13:09:12 2010 +0000 Partially fixed page cache management and kddm protocol interactions diff --git a/fs/kdfs/TODO b/fs/kdfs/TODO index 2c57e69..7c69c75 100644 --- a/fs/kdfs/TODO +++ b/fs/kdfs/TODO @@ -9,12 +9,6 @@ Prio. added added Type What 1 adrien 071212 bugfix superbloc: handling of clusterwide sbs (mount in any order) 2 adrien 071212 new_feature superbloc: improvements of mount (extraparemeters QoS, max) 2 adrien 071212 new_feature superbloc: improvements (several partitions on a node) -1 adrien 071212 bugfix paging: files are loaded into the kddm but the associated memory is never freed - => Bonnie on big file => out of core - => every page in a kddmset will be referenced in the local cache, this - way whenever the kernel wishes to discard a page in its local cache, - it will be discarded in the kddm set -2 adrien 071212 new_feature striping (e.g.: file .meta may contain the striping pattern and data servers) 2 adrien 071212 new_feature redundancy (e.g.: file .meta may contain the striping pattern and data servers) 3 adrien new_feature file versioning (snapshot) 4 adrien new_feature I/O probes to optimize process vs data placement @@ -40,11 +34,23 @@ Prio. added added Type What 2 pierre 080227 bugfix check about obj_entry->lock (spinlock) being locked in kddm_io_invalidate_object when calling kdfs_iol_inode_invalidate_object (which calls a sleeping function) + 2 adrien 100717 Bugfix check why we locally destroy the content kddm set the inode is dropped by the VFS (cfs. super.c kdfs_drop_inode) +2 adrien 100819 ls -al upon a directory returns a wrong size (should be 4096, however the realsize of the directory is returned) + DONE ~~~~ +1 adrien 071212 bugfix paging: files are loaded into the kddm but the associated memory is never freed + => Bonnie on big file => out of core + => every page in a kddmset will be referenced in the local cache, this + way whenever the kernel wishes to discard a page in its local cache, + it will be discarded in the kddm set +=> Done August 2010 - Adrien + +2 adrien 071212 new_feature striping (e.g.: file .meta may contain the striping pattern and data servers) +=> Done June 2010 - Adrien/Marko EOF diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index a8997fa..008b62b 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -196,6 +196,7 @@ int __kdfs_commit_write(struct file *file, kdfs_distmark_page_dirty(k_inode, page->index); _kdfs_put_page((struct kdfs_page*)page->private); + // TODO: Why synchronize the inode at each page modification, I presume that it should be done kdfs_mark_inode_dirty(k_inode); kdfs_iput(k_inode->inode->i_ino); @@ -250,20 +251,17 @@ void kdfs_invalidatepage(struct page *page, unsigned long offset) ASSERT(page->mapping != NULL); k_page = (struct kdfs_page *) page->private; + if (offset == 0) { /* The whole page is invalidated so it should be removed */ - DEBUG(DBG_INFO, "Gonna remove page %ld (objid %ld from set %ld)\n", page->index, k_page->obj_id,k_page->set_id); + /* TODO Should we really remove the page from the physical storage */ + /* Currently only the inode is updated, it seems to be sufficient */ + DEBUG(DBG_INFO, "Gonna invalidate page %ld (objid %ld from set %ld)\n", page->index, k_page->obj_id,k_page->set_id); kddm_remove_object(kddm_def_ns, k_page->set_id, k_page->obj_id); + + set_page_private(page, NULL); ClearPagePrivate(page); } - else { - //TODO Now Adrien : Fix that : sure or not sure ? - /* Not sure about this */ - ASSERT (1==0); - // kdfs_grab_distpage(k_page->set_id, k_page->obj_id); - // kddm_sync_frozen_object(kddm_def_ns, k_page->set_id, k_page->obj_id); -// __kdfs_put_page(k_page->set_id, k_page->obj_id); - } PRINT_FUNCTION_EXIT; } @@ -280,9 +278,14 @@ int kdfs_releasepage(struct page *page, gfp_t mask) k_page = (struct kdfs_page *) page->private; - kddm_flush_object(kddm_def_ns, k_page->set_id, k_page->obj_id, KERRIGHED_NODE_ID_NONE); - + DEBUG(DBG_INFO, "Gonna release page %ld (objid %ld from set %ld)\n", page->index, k_page->obj_id,k_page->set_id); + if(kddm_flush_object(kddm_def_ns, k_page->set_id, k_page->obj_id, KERRIGHED_NODE_ID_NONE) == -ENOSPC) + /* There is only one copy, so we should exploit remove instead of flush */ + kddm_remove_object(kddm_def_ns, k_page->set_id, k_page->obj_id); + + set_page_private(page, NULL); ClearPagePrivate(page); + PRINT_FUNCTION_EXIT; return 1; } @@ -624,6 +627,9 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, k_page->page = find_get_page(k_mapping, pageid); if (!k_page->page) { k_page->page = find_or_create_page(k_mapping, pageid, (mapping_gfp_mask(k_mapping)|__GFP_ZERO) & ~__GFP_FS); + //k_page->page = alloc_page(mapping_gfp_mask(k_mapping)|__GFP_ZERO) & ~__GFP_FS); + //lock_page(k_page->page); + k_page->flags = K_PG_locked; page_addr = (char *) kmap(k_page->page); @@ -643,8 +649,6 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, } else k_page->flags = K_PG_ok; - DEBUG(DBG_TRACE, "After find Page count=%d\n", page_count(k_page->page)); - kunmap(k_page->page); objEntry->object = (void *) k_page; @@ -676,8 +680,8 @@ int kdfs_iol_page_insert(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid) * released from local cache (cf. kdfs_invalidatepage or kdfs_releasepage) */ - SetPagePrivate(k_page->page); set_page_private(k_page->page, (unsigned long) k_page); + SetPagePrivate(k_page->page); /* * if the page has been created by kDFS, we should unlock the page @@ -749,6 +753,10 @@ int kdfs_iol_page_export (struct rpc_desc *desc, * @param objid Object id of the object * * @return 0 + * + * Notes: kdfs_iol_page_invalidate can only be triggered by a KDDM event. + * As a consequence, there is no possibility to get conflict with kernel cache operations + * When a page is invalidated or remove from the cache, kdfs_iol_page_remove is invoked on the node */ int kdfs_iol_page_invalidate(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid) @@ -767,14 +775,11 @@ int kdfs_iol_page_invalidate(kddm_obj_t *objEntry, kddm_set_t *set, DEBUG(DBG_INFO, "Try to invalidate objid %ld (page id %ld page addr %p) of set %lu\n", objid, k_page->page->index, k_page->page, set->id); trylock_page(k_page->page); - // TODO Remove Useless traces - DEBUG(DBG_ALERT, "Page count before =%d\n", page_count(k_page->page)); remove_from_page_cache(k_page->page); + set_page_private(page, NULL); ClearPagePrivate(k_page->page); unlock_page(k_page->page); page_cache_release(k_page->page); - // TODO Remove Useless traces - DEBUG(DBG_ALERT, "Page after count=%d\n", page_count(k_page->page)); PRINT_FUNCTION_EXIT; @@ -885,6 +890,7 @@ int kdfs_iol_page_remove(void *object, struct kddm_set *set, objid_t objid) struct kdfs_page *k_page = (struct kdfs_page *) object; PRINT_FUNCTION_NAME; + DEBUG(DBG_INFO, "Gonna remove objid %ld from set %ld\n", k_page->obj_id,k_page->set_id); if ((!PageLocked(k_page->page))) { /* * This is not the kernel trying to remove the page but the KDDMs, @@ -917,8 +923,8 @@ int content_instantiate(kddm_set_t *kddm_set, void *private_data, int master) { struct content_iolinker_data *content_data = NULL; struct inode *inode = NULL; + char * phys_dirname; int result = 0; - char *phys_dirname; struct file *filp; /* TODO NOW: Adrien */ @@ -941,20 +947,12 @@ int content_instantiate(kddm_set_t *kddm_set, void *private_data, int master) /* Retrieve local path corresponding to kfds inode number*/ kdfs_getphysicalpath(k_sb, content_data->ino, content_data->phys_dirname); - result = check_create_phys_dir(content_data->phys_dirname, 0777, 0, 0); - if (result != 0) - DEBUG(DBG_PANIC, "Something wrong during check_create_phys_dir (error=%d)", result); + phys_dirname = content_data->phys_dirname + strlen(content_data->phys_dirname); - /* Try to open the physical associated file */ - phys_dirname = content_data->phys_dirname + strlen(content_data->phys_dirname); - // For versionning purpose: TODO add specific defines - snprintf(content_data->phys_dirname, PATH_MAX, "%s/.meta.index", content_data->phys_dirname); - filp = open_phys_file(content_data->phys_dirname, O_RDONLY, 0644, 0, 0); - *phys_dirname = '\0'; - if (IS_ERR(filp)) { + if (!KDFS_VERSIONNING) { /* This file is not checkpointed, use the standard content file. */ snprintf(content_data->phys_dirname, PATH_MAX, "%s/" KDFS_CONTENT_FILENAME, content_data->phys_dirname); - filp = open_phys_file(content_data->phys_dirname, O_CREAT|O_LARGEFILE|O_RDWR, 0644, 0,0); + filp = check_create_phys_file(content_data->phys_dirname, 0644, 0,0); BUG_ON(IS_ERR(filp)); content_data->phys_file = filp; *phys_dirname = '\0'; @@ -964,9 +962,16 @@ int content_instantiate(kddm_set_t *kddm_set, void *private_data, int master) content_data->current_meta = NULL; } else { + /* Try to open the physical associated file */ + // This code is simply useless (cf. comment below) + // phys_dirname = content_data->phys_dirname + strlen(content_data->phys_dirname); + // snprintf(content_data->phys_dirname, PATH_MAX, "%s/.meta.index", content_data->phys_dirname); + // filp = check_create_phys_file(content_data->phys_dirname, 0644, 0,0); + /* This file is checkpointed, initialization will be done on the first read/write. */ content_data->phys_file = NULL; - + *phys_dirname = '\0'; + content_data->content_readphyspage = kdfs_content_readphyspage_cow; content_data->content_writephyspage = kdfs_content_writephyspage_cow; content_data->current_meta = NULL; diff --git a/fs/kdfs/address_space.h b/fs/kdfs/address_space.h index 1a569c7..fd06436 100644 --- a/fs/kdfs/address_space.h +++ b/fs/kdfs/address_space.h @@ -33,6 +33,8 @@ /* If defined, kDFS provides local striping policy */ #define KDFS_FILE_STRIPING 1 +/* If defined, kDFS provides versionning management based on the Pierre Riteau's proposal (experimental) */ +#define KDFS_VERSIONNING 0 /*--------------------------------------------------------------------------* * * diff --git a/fs/kdfs/dir.c b/fs/kdfs/dir.c index 31a9497..c0d0e0b 100644 --- a/fs/kdfs/dir.c +++ b/fs/kdfs/dir.c @@ -204,8 +204,8 @@ struct kdfs_dir_entry *kdfs_find_entry(struct kdfs_inode *dir, /* Did we find the right entry */ DEBUG(DBG_INFO, - "filelen %d dirfilelen %d, filename %s dirname %s, dirlen %d (dirino %ld)\n", - filename_len, dir_entry->name_len, filename, dir_entry->name,dir_entry->rec_len, dir_entry->ino); + "file:%s (filename_len %d), dir:%s (dirfilename_len %d), dirlen %d (dirino %ld)\n", + filename, filename_len, dir_entry->name, dir_entry->name_len, dir_entry->rec_len, dir_entry->ino); if (dir_entry->name_len == filename_len && strncmp (dir_entry->name, filename, filename_len) == 0) goto found; @@ -837,7 +837,7 @@ struct iolinker_struct dir_io_linker = { .invalidate_object = kdfs_iol_page_invalidate, .linker_name = "dir", .linker_id = DIR_LINKER, - .put_object = kdfs_iol_page_put, +// .put_object = kdfs_iol_page_put, .remove_object = kdfs_iol_page_remove, .sync_object = kdfs_iol_page_sync, .uninstantiate = dir_uninstantiate, diff --git a/fs/kdfs/file.c b/fs/kdfs/file.c index 367c23c..1fe9e23 100644 --- a/fs/kdfs/file.c +++ b/fs/kdfs/file.c @@ -168,9 +168,12 @@ out: return r; } + +// Seems to be mandatory to cleany handle file removals. +// TODO file/dir removal process has to be tackled int kdfs_release(struct inode *inode, struct file *filp) { - struct kdfs_inode *k_inode; +// struct kdfs_inode *k_inode; DEBUG(DBG_INFO, "Release file %s (i_size %lld) (inode %p)\n", @@ -178,10 +181,11 @@ int kdfs_release(struct inode *inode, struct file *filp) filp->f_dentry->d_inode->i_size, filp->f_dentry->d_inode); - k_inode = kdfs_igrab(inode->i_ino); +// That code seems buggy +/* k_inode = kdfs_igrab(inode->i_ino); atomic_dec(&k_inode->cw_count); kdfs_iput(inode->i_ino); - +*/ return 0; } @@ -305,7 +309,7 @@ struct iolinker_struct file_io_linker = { .invalidate_object = kdfs_iol_page_invalidate, .linker_name = "file", .linker_id = FILE_LINKER, - .put_object = kdfs_iol_page_put, +// .put_object = kdfs_iol_page_put, .remove_object = kdfs_iol_page_remove, .sync_object = kdfs_iol_page_sync, .uninstantiate = kdfs_iol_file_uninstantiate, diff --git a/fs/kdfs/inode.c b/fs/kdfs/inode.c index 5a06f64..18d557e 100644 --- a/fs/kdfs/inode.c +++ b/fs/kdfs/inode.c @@ -1086,19 +1086,19 @@ int kdfs_iol_inode_alloc_object (kddm_obj_t *objEntry, /* TODO PRIORITY 3: Adrien * interest of the following code inside the alloc function */ - if (inode_linked_node(objid) == kerrighed_node_id) { - char *phys_dirname; - /* Find the physical path corresponding to the KDFS inode */ - phys_dirname = kmalloc(PATH_MAX, GFP_KERNEL); - ASSERT(phys_dirname != NULL); - - kdfs_getphysicalpath(k_sb, objid, phys_dirname); - if (check_create_phys_dir(phys_dirname, 0777, 0, 0) != 0) - BUG(); - - kfree(phys_dirname); - } - +// if (inode_linked_node(objid) == kerrighed_node_id) { +// char *phys_dirname; +// /* Find the physical path corresponding to the KDFS inode */ +// phys_dirname = kmalloc(PATH_MAX, GFP_KERNEL); +// ASSERT(phys_dirname != NULL); +// +// kdfs_getphysicalpath(k_sb, objid, phys_dirname); +// if (check_create_phys_dir(phys_dirname, 0777, 0, 0) != 0) +// BUG(); +// +// kfree(phys_dirname); +// } +// __kdfs_twice_putsb(k_sb); PRINT_FUNCTION_EXIT; return 0; diff --git a/fs/kdfs/physical_fs.c b/fs/kdfs/physical_fs.c index 8bd60c1..05c0302 100644 --- a/fs/kdfs/physical_fs.c +++ b/fs/kdfs/physical_fs.c @@ -2,9 +2,8 @@ * KDDM File System - Access to Native File System. * @file physical_fs.c based on physical_fs.c from kerrighed code * - * Copyright (C) 2001-2006, INRIA, Universite de Rennes 1, EDF. - * Copyright (C) 2006-2007, Renaud Lottiaux, Kerlabs. - * Copyright (C) 2007-, Adrien Lebre, XtreemOS Consortium. + * Copyright (C) 2006-2007, XtreemOS Consortium. + * Copyright (C) 2008-20xx, Mines Nantes - INRIA Rennes Bretagne Atlantique - LINA . * * @author Renaud Lottiaux * @author Adrien Lebre @@ -180,7 +179,7 @@ out: * @return file_ptr pointer to the opened file * NULL - err_code error opening as indicated by the error code */ -struct file *open_phys_file(char *filename, int flags, int mode, uid_t uid, gid_t gid) +struct file *open_phys_file(const char *filename, int flags, int mode, uid_t uid, gid_t gid) { int error = 0; struct file *file = NULL; @@ -230,7 +229,7 @@ int close_phys_file(struct file *file) } /* - * Check whether the given path exists + * Check whether the given directory exists * If not, create it * * @author Marko Obrovac @@ -294,6 +293,69 @@ out_close: } /* + * Check whether the given file exists + * If not, create it + * + * @author Adrien Lebre + * + * @param pathname the path that has to be checked and/or created + * @param mode mode flags to create the dir with + * @param uid owner user id + * @param gid owner group id + * + * @return file decriptor if !IS_ERR(fp) otherwise fp contains the error. + * + * @comment the function will create the whole path + * if it doesn't exist. + * Example: pathname = /path1/path2/path3 + * if only /path1 exists, /path2 + * is created inside /path1 and + * then /path3 is created inside + * /path1/path2 + */ +struct file* check_create_phys_file(const char *pathname, + int mode, + uid_t uid, + gid_t gid) +{ + int error = 0; + struct file *fp; + char *path, *buf; + path = kmalloc(PATH_MAX, GFP_KERNEL); + buf = kmalloc(PATH_MAX, GFP_KERNEL); + ASSERT(path != NULL); + ASSERT(buf != NULL); + + buf[0] = 0; + strcpy(path, pathname); + + fp = open_phys_file(path, O_CREAT|O_LARGEFILE|O_RDWR, mode, 0, 0); + if (IS_ERR(fp)){ + // Parent directory(ies) does/do not exist, so create it/them + // First, remove filename + str_move_last_block(path, buf, '/'); + buf[0] = 0; + // Second create the missing directory/ies + do { + str_move_last_block(path, buf, '/'); + fp = open_phys_file(path, O_LARGEFILE|O_RDONLY, 0644, 0, 0); + if (!IS_ERR(fp)) + break; + } while (strlen(path)); + + while (strlen(buf)) { + str_move_last_block(buf, path, '/'); + error = create_phys_dir(path, mode, uid, gid); + } while (strlen(path) && (error !=0)); + + fp = open_phys_file(pathname,O_CREAT|O_LARGEFILE|O_RDWR, mode, 0, 0); + } + kfree(path); + kfree(buf); + return fp; +} + +/* * Read from a physical file * * @author Adrien Lebre @@ -350,7 +412,7 @@ int kdfs_phys_write(struct file *file, char *addr, size_t len, loff_t *pos) int ret; mm_segment_t old_fs; - DEBUG(DBG_INFO, "Write Native file %s\n", file->f_dentry->d_name.name); + DEBUG(DBG_INFO, "Write Native file %s to position %ld (size %ld)\n", file->f_dentry->d_name.name, *pos, len); old_fs = get_fs(); set_fs(KERNEL_DS); /* Enable to read in kernel memory */ diff --git a/fs/kdfs/physical_fs.h b/fs/kdfs/physical_fs.h index 590f9fd..eb80342 100644 --- a/fs/kdfs/physical_fs.h +++ b/fs/kdfs/physical_fs.h @@ -2,10 +2,10 @@ * KDDM File System - Access to Native File System. * @file physical_fs.h based on physical_fs.h from kerrighed code * - * Copyright (C) 2001-2006, INRIA, Universite de Rennes 1, EDF. - * Copyright (C) 2006-2007, Renaud Lottiaux, Kerlabs. - * Copyright (C) 2007-, Adrien Lebre, XtreemOS Consortium. + * Copyright (C) 2006-2007, XtreemOS Consortium. + * Copyright (C) 2008-20xx, Mines Nantes - INRIA Rennes Bretagne Atlantique - LINA . * + * @author Renaud Lottiaux * @author Adrien Lebre */ @@ -60,16 +60,18 @@ static inline void str_move_last_block(char *src, char *dest, char delimiter) * * *--------------------------------------------------------------------------*/ -struct file *open_phys_file (char *filename, int flags, int mode, uid_t uid, gid_t gid); +struct file *check_create_phys_file(const char *pathname, int mode, uid_t uid, gid_t gid); +struct file *open_phys_file (const char *filename, int flags, int mode, uid_t uid, gid_t gid); int close_phys_file (struct file *file); +int remove_phys_file(const char *filename, uid_t uid, gid_t gid); int kdfs_phys_read(struct file *file, char *addr, size_t len, loff_t *pos); int kdfs_phys_write(struct file *file, char *addr, size_t len, loff_t *pos); +long check_create_phys_dir(const char *pathname,int mode, uid_t uid,gid_t gid); + long create_phys_dir(const char *pathname, int mode, uid_t uid, gid_t gid); -long check_create_phys_dir(const char *pathname, int mode, uid_t uid, gid_t gid); long remove_phys_dir(const char *pathname, uid_t uid, gid_t gid); -int remove_phys_file(const char *filename, uid_t uid, gid_t gid); #endif // __KDFS_PHYSICAL_FS__ diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index 6fa8b65..cb5d069 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -1060,7 +1060,7 @@ int __kdfs_write_inode(struct kdfs_inode *k_inode) phys_filename); strcat(phys_filename,"/" KDFS_INODE_FILENAME); - file = open_phys_file(phys_filename, O_CREAT|O_RDWR, 0644,0 ,0); + file = check_create_phys_file(phys_filename, 0644,0 ,0); if (!IS_ERR(file)) { phys_inode.size = inode->i_size; phys_inode.nlink = inode->i_nlink; @@ -1083,7 +1083,7 @@ int __kdfs_write_inode(struct kdfs_inode *k_inode) kdfs_file_extent_dump_to_file(k_inode, file); close_phys_file(file); } else { - DEBUG (DBG_ALERT, + DEBUG (DBG_PANIC, "Can't access/create the KDFS inode %ld metafile \nPlease "\ "verify type of the partition %s, it should be a KDFS one "\ " (error %ld)\n", inode->i_ino, ----------------------------------------------------------------------- Summary of changes: fs/kdfs/TODO | 18 +++- fs/kdfs/address_space.c | 187 +++++++++++++++---------------------- fs/kdfs/address_space.h | 9 +- fs/kdfs/dir.c | 30 ++---- fs/kdfs/file.c | 50 ++-------- fs/kdfs/file_extent.c | 15 +++- fs/kdfs/file_extent.h | 2 + fs/kdfs/inode.c | 235 +++++++++++++++++------------------------------ fs/kdfs/physical_fs.c | 92 ++++++++++++++++--- fs/kdfs/physical_fs.h | 14 ++- fs/kdfs/super.c | 77 ++++++---------- 11 files changed, 335 insertions(+), 394 deletions(-) hooks/post-receive -- kdfs |
From: alebre <al...@us...> - 2010-10-02 12:53:36
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "UNNAMED PROJECT". The branch, master has been updated via 13bc25cdf1c8055f8a94e7113ae2d6f376a566a9 (commit) from 35fdf5274510594097cbdaeff670b95f33df1df1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 13bc25cdf1c8055f8a94e7113ae2d6f376a566a9 Author: ad <leb...@fr...> Date: Sat Oct 2 05:57:52 2010 +0000 Add the first kdfs_extent_info record for the first inode diff --git a/tools/mkfs_kdfs.c b/tools/mkfs_kdfs.c index 7e859fa..0376dc0 100644 --- a/tools/mkfs_kdfs.c +++ b/tools/mkfs_kdfs.c @@ -55,6 +55,18 @@ // from common.h #define KDFS_NAME_LEN 255 +#define KDFS_FILE_STRIPING 1 + +#if KDFS_FILE_STRIPING +typedef unsigned long pgoff_t; +typedef short kdfs_node_t; +struct kdfs_file_extent_info { + pgoff_t page_first; /* the first page no owned by a node */ + pgoff_t page_last; /* the last page no owned by a node */ + kdfs_node_t extent_owner; /* the node holding the pages contents */ +}; +#endif + /* A physical representation of kDFS inode is required. * First, to protect kDFS consistency (direct manipulations on the native FS * inodes will not impact on the kDFS structure). @@ -223,6 +235,17 @@ int main(int argc, char* argv[]) timespec_cpy(&root_inode.ctime,&root_inode.atime); fwrite(&root_inode,sizeof(struct kdfs_physical_inode), 1, filp); + +#if KDFS_FILE_STRIPING + size_t no_extents=1 ; + fwrite( ( void *)&no_extents, sizeof( size_t ), 1, filp ); + + struct kdfs_file_extent_info record; + record.page_first = 0; + record.page_last = 0; + record.extent_owner = nodeid; + fwrite(&record,sizeof(struct kdfs_file_extent_info), 1, filp); +#endif fclose(filp); /* Create the . and .. entries */ @@ -247,6 +270,8 @@ int main(int argc, char* argv[]) fwrite(&dot_entry, sizeof(dot_entry), 1, filp); fwrite(&dot_dot_entry, sizeof(dot_dot_entry), 1, filp); fclose(filp); + + } filp = fopen(directory_path, "w"); ----------------------------------------------------------------------- Summary of changes: tools/mkfs_kdfs.c | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) hooks/post-receive -- UNNAMED PROJECT |
From: alebre <al...@us...> - 2010-07-19 14:46:06
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "kdfs". The branch, make_kdfs_compile has been updated via c97311254a567ed0ead630ce8f2e681c81c70478 (commit) from 0a5fafb4d704c3289c4098cd1f0630a73ad763bf (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c97311254a567ed0ead630ce8f2e681c81c70478 Author: ad <leb...@fr...> Date: Mon Jul 19 15:35:19 2010 +0000 Fix dir entry management issue and minor bugs on inode management diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index 99331b6..a8997fa 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -629,8 +629,8 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, page_addr = (char *) kmap(k_page->page); pos = (loff_t)pageid * PAGE_SIZE; - DEBUG(DBG_TRACE, "Can't find page for file/directory = %ld and " \ - "page id = %ld, So created and locked (kmap page address %p, page address %p)\n", iolinker_data->ino, + DEBUG(DBG_TRACE, "The page for file/directory = %ld and " \ + "page id = %ld is not in the cache. So created/locked and read from HDD (kmap page address %p, page address %p)\n", iolinker_data->ino, pageid,page_addr, k_page->page); /* The page should be filled only if it was not handled diff --git a/fs/kdfs/dir.c b/fs/kdfs/dir.c index 5a0f3b4..31a9497 100644 --- a/fs/kdfs/dir.c +++ b/fs/kdfs/dir.c @@ -444,7 +444,7 @@ int kdfs_add_dir_entry(struct kdfs_inode *kdfs_pdir, char *filename, ino_t ino, kdfs_mark_inode_dirty(kdfs_pdir); /* Propagate change to the device on the right node */ - kdfs_mark_page_dirty(kdfs_pdir->content_setid, pageid); + kdfs_mark_page_dirty(kdfs_pdir->content_setid, kdfs_page->obj_id); _kdfs_put_page(kdfs_page); diff --git a/fs/kdfs/inode.c b/fs/kdfs/inode.c index d6536d5..5a06f64 100644 --- a/fs/kdfs/inode.c +++ b/fs/kdfs/inode.c @@ -1128,9 +1128,9 @@ int kdfs_iol_inode_first_touch(kddm_obj_t *objEntry, struct kdfs_super_block *k_sb = kdfs_twice_grabsb(kerrighed_node_id); ASSERT(k_sb != NULL); - DEBUG(DBG_INFO, - "First touch inode (%ld;%ld)\n", - kddm_set->id, objid); + DEBUG(DBG_TRACE, + "function ENTER: First touch inode (%ld;%ld) (creation = %d)\n", + kddm_set->id, objid, (flags & KDDM_CREATE_ON_FT)); k_inode = kmalloc(sizeof(struct kdfs_inode), GFP_KERNEL); ASSERT(k_inode != NULL); @@ -1151,11 +1151,12 @@ int kdfs_iol_inode_first_touch(kddm_obj_t *objEntry, insert_inode_hash(k_inode->inode); } // Case 2: the inode already exists, so fill it from the HDD - else if (kdfs_fill_kinode(k_sb->sb, objid, k_inode) < 0) { - DEBUG(DBG_PANIC, "Cannot retrieve the physical informations to fill the k_inode"); + else { + if (kdfs_fill_kinode(k_sb->sb, objid, k_inode) < 0) + DEBUG(DBG_PANIC, "Cannot retrieve the physical informations to fill the k_inode"); + k_inode->flags = K_INODE_OK; } - k_inode->flags = K_INODE_OK; k_inode->content_setid = KDDM_SET_UNUSED; objEntry->object = (void *) k_inode; DEBUG(DBG_INFO, "inode count %d\n", atomic_read(&k_inode->inode->i_count)); diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index d91e522..6fa8b65 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -932,7 +932,6 @@ int kdfs_statfs(struct dentry *dfs, struct kstatfs *buf) */ int kdfs_fill_kinode(struct super_block *sb, unsigned long ino, struct kdfs_inode *k_inode) { - struct inode *inode = NULL; struct file *file = NULL; char *phys_filename = NULL; struct kdfs_physical_inode phys_inode; @@ -948,8 +947,8 @@ int kdfs_fill_kinode(struct super_block *sb, unsigned long ino, struct kdfs_inod * For the moment, the workaround consists in using sb->s_fs_info to * reach it. It is probably not the best and cleanest solution. */ - inode = iget_locked(sb, ino); - if (!inode){ + k_inode->inode = iget_locked(sb, ino); + if (!k_inode->inode){ DEBUG(DBG_ALERT, "End of Memory, cannot allocate a new inode"); return -ENOMEM; } @@ -957,15 +956,14 @@ int kdfs_fill_kinode(struct super_block *sb, unsigned long ino, struct kdfs_inod * Check if the inode is locally in the cache * Should not occur (theoretically :/) */ - if (!(inode->i_state & I_NEW)){ + if (!(k_inode->inode->i_state & I_NEW)){ DEBUG(DBG_ALERT, "Inode already in the cache, strange...."); - k_inode->inode=inode; } /* Retrieve the inode meta file */ phys_filename = kmalloc(PATH_MAX, GFP_KERNEL); ASSERT(phys_filename != NULL); - kdfs_getphysicalpath(inode->i_sb->s_fs_info, inode->i_ino, + kdfs_getphysicalpath(k_inode->inode->i_sb->s_fs_info, k_inode->inode->i_ino, phys_filename); strcat(phys_filename, "/" KDFS_INODE_FILENAME); @@ -974,15 +972,15 @@ int kdfs_fill_kinode(struct super_block *sb, unsigned long ino, struct kdfs_inod kdfs_phys_read(file, (char *)&(phys_inode), sizeof(struct kdfs_physical_inode), &file->f_pos); - inode->i_size = phys_inode.size; - inode->i_mode = phys_inode.mode; - inode->i_nlink = phys_inode.nlink; - inode->i_version = phys_inode.version; - inode->i_uid = phys_inode.uid; - inode->i_gid = phys_inode.gid; - timespec_cpy(&inode->i_atime, &phys_inode.atime); - timespec_cpy(&inode->i_mtime, &phys_inode.mtime); - timespec_cpy(&inode->i_ctime, &phys_inode.ctime); + k_inode->inode->i_size = phys_inode.size; + k_inode->inode->i_mode = phys_inode.mode; + k_inode->inode->i_nlink = phys_inode.nlink; + k_inode->inode->i_version = phys_inode.version; + k_inode->inode->i_uid = phys_inode.uid; + k_inode->inode->i_gid = phys_inode.gid; + timespec_cpy(&k_inode->inode->i_atime, &phys_inode.atime); + timespec_cpy(&k_inode->inode->i_mtime, &phys_inode.mtime); + timespec_cpy(&k_inode->inode->i_ctime, &phys_inode.ctime); /* * Note: from VFS documentation, read_inode is in charge of @@ -991,9 +989,7 @@ int kdfs_fill_kinode(struct super_block *sb, unsigned long ino, struct kdfs_inod * kdfs_iol_inode_insert() due to the clusterwide constraints * (cf. inode.c) */ - - k_inode-> inode = inode ; - + /* * Read the extent part * copy/paste from kdfs_file_extent_read_from_file(struct kdfs_inode *k_inode) @@ -1023,10 +1019,10 @@ int kdfs_fill_kinode(struct super_block *sb, unsigned long ino, struct kdfs_inod DEBUG(DBG_ALERT, "Can't access to the KDFS inode %ld\n" "Please verify type of the partition %s, it should be a KDFS one", - inode->i_ino, ((struct kdfs_super_block*)inode->i_sb->s_fs_info)->k_opt->part_name); + k_inode->inode->i_ino, ((struct kdfs_super_block*)k_inode->inode->i_sb->s_fs_info)->k_opt->part_name); kfree(phys_filename); - unlock_new_inode(inode); + unlock_new_inode(k_inode->inode); PRINT_FUNCTION_EXIT; return 0; } ----------------------------------------------------------------------- Summary of changes: fs/kdfs/address_space.c | 4 ++-- fs/kdfs/dir.c | 2 +- fs/kdfs/inode.c | 13 +++++++------ fs/kdfs/super.c | 36 ++++++++++++++++-------------------- 4 files changed, 26 insertions(+), 29 deletions(-) hooks/post-receive -- kdfs |
From: alebre <al...@us...> - 2010-07-16 18:01:02
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "UNNAMED PROJECT". The branch, master has been updated via 35fdf5274510594097cbdaeff670b95f33df1df1 (commit) via f3cf7e6ca688d5e1adabdeed392b744453400a54 (commit) via ab810eedba82ed6731b347dcf379ebc34c224d01 (commit) via c2150acefeb7fa7022670a195efe2ff9a7310d02 (commit) via f689e67ac7c5b4630b07852943410c1160af895d (commit) via bd3ecaec690a95769898f92fe21fa946b2653214 (commit) via ff863be71dca87ef64657b7fb393ce3e1e6781a5 (commit) via 05fa834a1d7a1f0aac9a12f6c5d7452c7335a0da (commit) via 97273920e6102f2a72365334e16c403c8a77a630 (commit) via 6dc54aa27e83a5c4bb3f0796764e3c684bbae5cd (commit) via 51832b81b8a4aa5c17a70e544b3fe0b138e50bdc (commit) via 58f8b8c46185d85b4add8a1add58c93f494b3c6b (commit) via d9d5afc71b4843398348ed39e1261e0971a967ab (commit) via b2df163bc1676cb814135930aa092dd385f9dec9 (commit) via e8b99d2e2ae420580d027ae832d38877472bab06 (commit) via b7bab9834b1026b860e9cd8944dca5eee4eac5a4 (commit) via 139891819f6376cbf419372a0d830301c2f8a308 (commit) via a3b15b48fc3af345b7fc90bcfaf020d1cdb07436 (commit) via a1ea6fddea71c76f2e60ce627f382684d5079c9b (commit) via 4100459b5a1dd9e3d25119776e70966690b19d80 (commit) via cc9129d5e1ae3da23a250f4044826d5e339daf49 (commit) via 28dac08c8128d91eb33142051076e5be6579783f (commit) via e31870a1c90b14bd93bb5d7dd4b3dbad8db21838 (commit) via 76e477595b08b7ab285695b26da33b5eda2b5633 (commit) via 3cd29a62d1a9add320d76f7ed40d7260a2d4656c (commit) via 7d49161efa05bef0b2ddb516502b6f6e27ffe831 (commit) via 08a4ca7ad0b2eb4cfea69676ec8b08598da47e20 (commit) via 45c36eed1382491b832d098ab0d96dd8525bc260 (commit) from e85c92f17d0969a80f3e9ea0a0147ee14b215772 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 35fdf5274510594097cbdaeff670b95f33df1df1 Author: ad <leb...@fr...> Date: Fri Jul 16 08:35:28 2010 +0000 adding a dummy compilation script diff --git a/scripts/compile-tools b/scripts/compile-tools index 907b3df..662f171 100755 --- a/scripts/compile-tools +++ b/scripts/compile-tools @@ -1,4 +1,4 @@ ./autogen.sh - ./configure --disable-kernel + ./configure --disable-kernel --sysconfdir=/etc make sudo make install diff --git a/tools/Makefile.am b/tools/Makefile.am index 839edb6..b933e82 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -6,8 +6,8 @@ ### Author: ### Jean Parpaillon <jea...@ke...> ### - -sbindir=$(exec-prefix)/sbin +# Commented by Adrien +#sbindir=$(exec-prefix)/sbin dist_sbin_SCRIPTS = krginit_helper krg_legacy_scheduler bin_PROGRAMS = migrate checkpoint restart krgcapset krgcr-run ipccheckpoint ipcrestart commit f3cf7e6ca688d5e1adabdeed392b744453400a54 Merge: e85c92f ab810ee Author: root <root@krgserver.dirty.world> Date: Tue Jul 6 15:06:25 2010 +0000 Merge branch 'master' of git://mirrors.git.kernel.org/cluster/kerrighed/tools commit ab810eedba82ed6731b347dcf379ebc34c224d01 Author: Jean Parpaillon <jea...@ke...> Date: Wed Jun 30 15:37:12 2010 +0200 Update Kerrighed version to 3.0.0 diff --git a/configure.ac b/configure.ac index 4a88d81..337bbb5 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ AC_PREREQ(2.59) dnl mandatory stuff define([project], [kerrighed]) define([gitversion], esyscmd([sh -c "which git > /dev/null && git describe | sed -e 's/]project[-\([^-]\+\)//' | tr -d '\n' || true"]))dnl -AC_INIT(project, [3.0rc1]gitversion, [ker...@ir...]) +AC_INIT(project, [3.0.0]gitversion, [ker...@ir...]) AC_DEFINE(GITVERSION, "gitversion", [GIT version]) dnl check host and target commit c2150acefeb7fa7022670a195efe2ff9a7310d02 Author: Jean Parpaillon <jea...@ke...> Date: Wed Jun 30 15:36:12 2010 +0200 Remove local definition of CFLAGS to use global one (in configure.ac) diff --git a/tests/apps/Makefile.am b/tests/apps/Makefile.am index 44c0bf0..b1c5af3 100644 --- a/tests/apps/Makefile.am +++ b/tests/apps/Makefile.am @@ -6,8 +6,6 @@ ### Authors: ### Jean Parpaillon <jea...@ke...> ### -AM_CFLAGS = -Wall -Werror - bin_PROGRAMS = bi bi-cr bi-cr-static bi-file bi-signal bi-double \ bi-clone-files bi-clone-fs bi-clone-semundo bi-thread bi-server-socket \ bi-pipe bi-exclude-mm bi-cr-disable \ commit f689e67ac7c5b4630b07852943410c1160af895d Author: Matthieu Fertré <mat...@ke...> Date: Wed Jun 16 18:02:32 2010 +0200 [KTP] Add test cr_blender to check behavior of blender after checkpointing/restarting The test is simply skipped if blender is not installed. diff --git a/tests/ktp/cr/Makefile.am b/tests/ktp/cr/Makefile.am index 98a5a50..f81568c 100644 --- a/tests/ktp/cr/Makefile.am +++ b/tests/ktp/cr/Makefile.am @@ -53,9 +53,14 @@ tests_SCRIPTS = \ cr_pipe01 \ cr_pipe02 \ cr_exclude_mm01 \ + cr_blender \ lib_cr.sh \ lib_cr_ipc.sh +tests_DATA = \ + duck11_peaking.blend \ + duck11_peaking_render_1.png + testsdir = @ltpbase@/testcases/bin -EXTRA_DIST = $(tests_SCRIPTS) +EXTRA_DIST = $(tests_SCRIPTS) $(tests_DATA) diff --git a/tests/ktp/cr/cr_blender b/tests/ktp/cr/cr_blender new file mode 100644 index 0000000..4c9bcfa --- /dev/null +++ b/tests/ktp/cr/cr_blender @@ -0,0 +1,95 @@ +#!/bin/bash +############################################################################### +## +## Copyright (c) INRIA, 2007 +## +## This program is free software; you can redistribute it and#or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +## for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +## +############################################################################### +# +# Description: Test program for Kerrighed checkpoint/restart with blender. +# This test is basically a copy of cr10 +# +# Author: Matthieu Fertré, mat...@ke... +# + +source `dirname $0`/lib_cr.sh + +description="Run, C, K, R, C, K, R, R (EBUSY), K, R - Blender" + +TESTCMD="blender-bin" +inputbl="`dirname $0`/duck11_peaking.blend" +outputchecked="`dirname $0`/duck11_peaking_render_1.png" + +# Run, C, K, R, C, K, R, R (EBUSY), K, R +cr_blender() +{ + TCID="$FUNCNAME" # Identifier of this testcase. + TST_COUNT=$[$TST_COUNT+1] # Test case number. + + # look for Blender + which $TESTCMD > /dev/null + if [ $? -ne 0 ]; then + tst_resm TWARN "Can not run this test if $TESTCMD is not installed" + return 0 # to not stop krgltp + fi + + if [ ! -f $inputbl ]; then + tst_resm TWARN "Can not run this test if $inputbl is not installed" + return 0 # to not stop krgltp + fi + + if [ ! -f $outputchecked ]; then + tst_resm TWARN "Can not run this test if $outputchecked is not installed" + return 0 # to not stop krgltp + fi + + local output="$CHKPTDIR/render_krg_$$_#" + local renderoptions="-F PNG -f 1" + + TESTCMD_OPTIONS="-b $inputbl -o $output $renderoptions" + runcommand +CHECKPOINTABLE 1 nosync || return $? + + # let the process really begin + sleep 20 + + checkpoint_process $PID $TESTCMD || return $? + + kill_group $PID $TESTCMD || return $? + + restart_process $PID 1 $TESTCMD || return $? + + checkpoint_process $PID $TESTCMD || return $? + + kill_group $PID $TESTCMD || return $? + + restart_process $PID 2 $TESTCMD || return $? + + restart_process_must_fail $PID 1 $TESTCMD || return $? + + kill_group $PID $TESTCMD || return $? + + restart_foreground_process $PID 2 $TESTCMD || return $? + + # check image are the same + diff -q $outputchecked $CHKPTDIR/render_krg_$$_1.png || return $? + + print_success $? + return $? +} + +CR_setup $@ || exit $? + +cr_blender || exit $? diff --git a/tests/ktp/cr/duck11_peaking.blend b/tests/ktp/cr/duck11_peaking.blend new file mode 100644 index 0000000..b23a513 Binary files /dev/null and b/tests/ktp/cr/duck11_peaking.blend differ diff --git a/tests/ktp/cr/duck11_peaking_render_1.png b/tests/ktp/cr/duck11_peaking_render_1.png new file mode 100644 index 0000000..c40517e Binary files /dev/null and b/tests/ktp/cr/duck11_peaking_render_1.png differ diff --git a/tests/ktp/cr/lib_cr.sh b/tests/ktp/cr/lib_cr.sh index f2963d2..5bbcd8b 100755 --- a/tests/ktp/cr/lib_cr.sh +++ b/tests/ktp/cr/lib_cr.sh @@ -498,6 +498,29 @@ restart_process_must_fail() return $r } +restart_foreground_process() +{ + local _pid=$1 + local _version=$2 + local _name=$3 + local r=0 + + # Restart process + restart -q -f $_pid $_version + + r=$? + if [ $r -ne 0 ]; then + tst_brkm TFAIL NULL \ + "restart_foreground: failed to restart $_pid $version" + return $r + fi + + LTP_print_step_info \ + "restart_foreground $_pid $_name: $r" + + return $r +} + ############################################################################### skip_test_if_only_one_node() commit bd3ecaec690a95769898f92fe21fa946b2653214 Author: Matthieu Fertré <mat...@ke...> Date: Wed Jun 16 15:53:47 2010 +0200 [KTP] lib_cr.sh: use a variable for "/var/chkpt" diff --git a/tests/ktp/cr/lib_cr.sh b/tests/ktp/cr/lib_cr.sh index c498863..f2963d2 100755 --- a/tests/ktp/cr/lib_cr.sh +++ b/tests/ktp/cr/lib_cr.sh @@ -31,6 +31,7 @@ TESTCMD="bi-cr" TESTCMD_OPTIONS="-q" TEST_STEP=0 +CHKPTDIR="/var/chkpt" LTP_print_info() { @@ -68,7 +69,7 @@ move_task_file_to_make_restart_fail() local r=0 local version=`awk '$1=="Version:" {print $2}' /tmp/chkpt_result${_pid}` - local filechkpt=/var/chkpt/${_pid}/v${version}/task_${_pid}.bin + local filechkpt=$CHKPTDIR/${_pid}/v${version}/task_${_pid}.bin mv $filechkpt $filechkpt.old r=$? @@ -82,7 +83,7 @@ move_task_back_file_to_make_restart_ok() local r=0 local version=`awk '$1=="Version:" {print $2}' /tmp/chkpt_result${_pid}` - local filechkpt=/var/chkpt/${_pid}/v${version}/task_${_pid}.bin + local filechkpt=$CHKPTDIR/${_pid}/v${version}/task_${_pid}.bin mv $filechkpt.old $filechkpt r=$? @@ -98,7 +99,7 @@ check_written_files() # check if checkpoint is really written on disk # TODO: factorize(1) local version=`awk '$1=="Version:" {print $2}' /tmp/chkpt_result${_pid}` - local filechkpt=/var/chkpt/${_pid}/v${version}/task_${_pid}.bin + local filechkpt=$CHKPTDIR/${_pid}/v${version}/task_${_pid}.bin stat $filechkpt > /dev/null 2>&1 r=$? @@ -835,7 +836,7 @@ CR_internal_cleanup() CR_cleanup() { killall `echo "$TESTCMD" | cut -f1 -d" "` > /dev/null 2>&1 - rm -rf /var/chkpt/* > /dev/null 2>&1 + rm -rf $CHKPTDIR/* > /dev/null 2>&1 rm -rf /tmp/chkpt_result* > /dev/null 2>&1 rm -rf /tmp/ps_* > /dev/null 2>&1 rm -rf /tmp/ktp_sync_* > /dev/null 2>&1 commit ff863be71dca87ef64657b7fb393ce3e1e6781a5 Author: Matthieu Fertré <mat...@ke...> Date: Wed Jun 16 18:03:28 2010 +0200 restart: add an option to restart an application in frozen state. The option is -U|--no-unfreeze. diff --git a/man/restart.1.xml b/man/restart.1.xml index e8bf88d..b3beb66 100644 --- a/man/restart.1.xml +++ b/man/restart.1.xml @@ -55,6 +55,17 @@ </varlistentry> <varlistentry> + <term><option>-U</option></term> + <term><option>--no-unfreeze</option></term> + <listitem> + <para>Restore the application in FROZEN state. Application can then + be unfrozen using <command>checkpoint</command> with the + appropriate option. + </para> + </listitem> + </varlistentry> + + <varlistentry> <term><option>-t</option></term> <term><option>--replace-tty</option></term> <listitem> diff --git a/tools/restart.c b/tools/restart.c index 6aba49b..20e72db 100644 --- a/tools/restart.c +++ b/tools/restart.c @@ -30,6 +30,7 @@ int options = 0; #define STDIN_OUT_ERR 2 #define QUIET 4 #define DEBUG 8 +#define NOUNFREEZE 16 struct cr_subst_files_array substitution; @@ -54,6 +55,7 @@ void show_help(char * program_name) "Options:\n" " -h|--help Display this information and exit\n" " -v|--version Display version information\n" + " -U|--no-unfreeze Leave the application frozen after the restart\n" " -t|--replace-tty Replace application original terminal by the current one\n" " -f|--foreground Restart the application in foreground\n" " -p|--pids Replace application orphan pgrp and sid by the ones of restart\n" @@ -269,7 +271,7 @@ int parse_args(int argc, char *argv[]) char *checkpoint_dir; char c; int r, option_index = 0; - char * short_options= "hvftps:qd"; + char * short_options= "hvftps:Uqd"; static struct option long_options[] = { {"help", no_argument, 0, 'h'}, @@ -278,6 +280,7 @@ int parse_args(int argc, char *argv[]) {"tty", no_argument, 0, 't'}, {"pids", no_argument, 0, 'p'}, {"substitute-file", required_argument, 0, 's'}, + {"no-unfreeze", no_argument, 0, 'U'}, {"quiet", no_argument, 0, 'q'}, {"debug", no_argument, 0, 'd'}, {0, 0, 0, 0} @@ -313,6 +316,9 @@ int parse_args(int argc, char *argv[]) case 'd': options |= DEBUG; break; + case 'U': + options |= NOUNFREEZE; + break; default: show_help(argv[0]); exit(EXIT_FAILURE); @@ -449,16 +455,24 @@ int main(int argc, char *argv[]) goto exit; } - r = application_unfreeze_from_appid(appid, 0); - if (r) { - fprintf(stderr, "restart: fail to unfreeze application %ld: " - "%s\n", appid, strerror(errno)); - goto exit; - } + if (!(options & NOUNFREEZE)) { + r = application_unfreeze_from_appid(appid, 0); + if (r) { + fprintf(stderr, "restart: fail to unfreeze application %ld: " + "%s\n", appid, strerror(errno)); + goto exit; + } - if (!(options & QUIET)) - printf("Application %ld has been successfully restarted\n", - appid); + if (!(options & QUIET)) + printf("Application %ld has been successfully restarted\n", + appid); + } else { + if (!(options & QUIET)) + printf("Application %ld has been successfully restored " + "in *FROZEN* state. You can unfreeze it using " + "'checkpoint -u'\n", + appid); + } if (options & FOREGROUND) wait_application_exits(); commit 05fa834a1d7a1f0aac9a12f6c5d7452c7335a0da Author: Matthieu Fertré <mat...@ke...> Date: Mon Jun 7 16:03:49 2010 +0200 Checkpoint: install a signal handler to avoid leaving with frozen application diff --git a/tools/checkpoint.c b/tools/checkpoint.c index 48622de..3dc1fde 100644 --- a/tools/checkpoint.c +++ b/tools/checkpoint.c @@ -32,6 +32,7 @@ typedef enum { short from_appid = 0; short quiet = 0; short no_callbacks = 0; +short interrupted_by_signal = 0; int sig = 0; int flags = 0; char * description = NULL; @@ -278,8 +279,16 @@ void clean_checkpoint_dir(struct checkpoint_info *info) int checkpoint_app(long pid, int flags, short _quiet) { int r; - struct checkpoint_info info; + + if (interrupted_by_signal) { + fprintf(stderr, + "checkpoint: interrupted by signal before " + "checkpointing\n"); + r = -1; + goto err; + } + if (from_appid) { if (!_quiet) printf("Checkpointing application %ld...\n", pid); @@ -301,6 +310,7 @@ int checkpoint_app(long pid, int flags, short _quiet) clean_checkpoint_dir(&info); } +err: return r; } @@ -308,6 +318,13 @@ int freeze_app(long pid, int _quiet) { int r; + if (interrupted_by_signal) { + fprintf(stderr, + "checkpoint: interrupted by signal before freezing\n"); + r = -1; + goto err; + } + if (!no_callbacks) { r = cr_execute_chkpt_callbacks(pid, from_appid); if (r) { @@ -341,6 +358,19 @@ int unfreeze_app(long pid, int signal, short _quiet) { int r; + if (interrupted_by_signal) { + if (action == ALL) { + fprintf(stderr, + "checkpoint: ignoring interruption signal\n"); + } else { + fprintf(stderr, + "checkpoint: interrupted by signal before " + "unfreezing\n"); + r = -1; + goto err; + } + } + if (!no_callbacks) { r = cr_execute_continue_callbacks(pid, from_appid); if (r) { @@ -396,10 +426,17 @@ err_chkpt: return r; } + +void handle_signal(int signum) +{ + interrupted_by_signal = 1; +} + int main(int argc, char *argv[]) { int r = 0; long pid = -1; + struct sigaction sigh; /* Manage options with getopt */ parse_args(argc, argv); @@ -419,6 +456,18 @@ int main(int argc, char *argv[]) goto exit; } + /* + * put a signal handler to avoid, for instance, exiting + * without unfreezing the application. + */ + sigh.sa_handler = &handle_signal; + r = sigaction(SIGINT, &sigh, NULL); + if (r) + perror("sigaction"); + r = sigaction(SIGTERM, &sigh, NULL); + if (r) + perror("sigaction"); + switch (action) { case CHECKPOINT: r = checkpoint_app(pid, flags, quiet); commit 97273920e6102f2a72365334e16c403c8a77a630 Author: Matthieu Fertré <mat...@ke...> Date: Mon Jun 14 15:09:25 2010 +0200 [BUGFIX] Fix build of ipcshm-tool diff --git a/tests/apps/ipcshm-tool.c b/tests/apps/ipcshm-tool.c index 5d9630e..ddded4f 100644 --- a/tests/apps/ipcshm-tool.c +++ b/tests/apps/ipcshm-tool.c @@ -235,7 +235,7 @@ int main(int argc, char* argv[]) exit(EXIT_FAILURE); } shm_size = buf.st_size; - print_msg("%d: size: %zd\n", shmid, shm_size); + print_msg("size: %zd\n", shm_size); } shmid = create_shm(argv[argc-1]); commit 6dc54aa27e83a5c4bb3f0796764e3c684bbae5cd Author: Renaud Lottiaux <Ren...@ke...> Date: Mon Jun 7 16:32:30 2010 +0200 Update the ChangeLog file. diff --git a/ChangeLog b/ChangeLog index a6da7a1..f5dada1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ +Kerrighed version 3.0.0 * [kernel] Port to linux 2.6.30 + Features: Checkpoint/restart * Add various options to checkpoint and restart @@ -18,6 +20,7 @@ * [kernel] Many bugfixes in socket migration * [kernel] Support migration / remote fork of chrooted applications * [kernel] Many migration fixes + * [kernel] Support migration/distant fork of swapping processes. * Remove limitation on number of concurrent executions in KTP Kerrighed version 2.4.4 commit 51832b81b8a4aa5c17a70e544b3fe0b138e50bdc Author: Matthieu Fertré <mat...@ke...> Date: Mon Jun 7 15:15:19 2010 +0200 C/R: Remove function krg_check_checkpoint() krg_check_checkpoint() was only used to check if /var/chkpt exists. The problem is that it prevent to get a clear message in case of failure because the dirname gets hidden. The function may be reintroduced one day if there is a way to check if the kernel supports checkpointing. diff --git a/libs/libkerrighed/libproc.c b/libs/libkerrighed/libproc.c index b25ff2c..5ff1100 100644 --- a/libs/libkerrighed/libproc.c +++ b/libs/libkerrighed/libproc.c @@ -26,20 +26,6 @@ /* */ /*****************************************************************************/ -int krg_check_checkpoint(void) -{ - struct stat buffer; - int status; - - status = stat(CHKPT_DIR, &buffer); - if (status) { - errno = ENOENT; - return -1; - } - - return 0; -} - /* Return the node id of the local machine */ int get_node_id (void) diff --git a/tools/checkpoint.c b/tools/checkpoint.c index e869095..48622de 100644 --- a/tools/checkpoint.c +++ b/tools/checkpoint.c @@ -10,6 +10,7 @@ #include <stdlib.h> #include <stdio.h> #include <signal.h> +#include <sys/stat.h> #include <errno.h> #include <fcntl.h> #include <string.h> @@ -142,20 +143,20 @@ void parse_args(int argc, char *argv[]) void check_environment(void) { + struct stat buffer; int ret; /* is Kerrighed launched ? */ ret = krg_check_hotplug(); - if (ret) - { + if (ret) { perror("Kerrighed is not started"); exit(EXIT_FAILURE); } - /* Is checkpoint available ? */ - ret = krg_check_checkpoint(); + /* Does /var/chkpt exist ? */ + ret = stat(CHKPT_DIR, &buffer); if (ret) { - perror("Checkpointing is not available"); + perror(CHKPT_DIR); exit(EXIT_FAILURE); } } diff --git a/tools/restart.c b/tools/restart.c index 12ed5a4..6aba49b 100644 --- a/tools/restart.c +++ b/tools/restart.c @@ -21,8 +21,6 @@ #include <config.h> -#define CHKPT_DIR "/var/chkpt" - long appid; int version; int flags = 0; @@ -403,20 +401,20 @@ void wait_application_exits() void check_environment(void) { struct stat buffer; - int status; + int ret; /* is Kerrighed launched ? */ - if (get_nr_nodes() == -1) - { - fprintf(stderr, "no kerrighed nodes found\n"); - exit(-EPERM); + ret = krg_check_hotplug(); + if (ret) { + perror("Kerrighed is not started"); + exit(EXIT_FAILURE); } - /* /var/chkpt exists ? */ - status = stat(CHKPT_DIR, &buffer); - if (status) { + /* Does /var/chkpt exist ? */ + ret = stat(CHKPT_DIR, &buffer); + if (ret) { perror(CHKPT_DIR); - exit(-ENOENT); + exit(EXIT_FAILURE); } } commit 58f8b8c46185d85b4add8a1add58c93f494b3c6b Author: Matthieu Fertré <mat...@ke...> Date: Thu Jun 3 14:17:15 2010 +0200 [tests] ipcshm-tool can get its message from a file In addition, the size of the SHM is created at exactly the needed size to store the initial message. That means that next writings will be limited to that length. diff --git a/tests/apps/ipcshm-tool.c b/tests/apps/ipcshm-tool.c index 5b8bcf5..5d9630e 100644 --- a/tests/apps/ipcshm-tool.c +++ b/tests/apps/ipcshm-tool.c @@ -1,23 +1,40 @@ #include <errno.h> +#include <fcntl.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/ipc.h> +#include <sys/mman.h> #include <sys/shm.h> +#include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #include "libbi.h" #define KTP_TEST 1 -#define SHM_SIZE 1024 +#define DEFAULT_SHM_SIZE 1024 -int create = 0; int use_id = 0; int quiet = 0; int nb_loops = 0; -char msg[SHM_SIZE]; +size_t shm_size = DEFAULT_SHM_SIZE; + +typedef enum { + NONE, + CREATE, + CREATE_FROM_FILE, + DELETE, + READ, + WRITE, + WRITE_FROM_FILE +} action_t; + +action_t action; + +char *msg = NULL; +char *path_msg = NULL; key_t get_key(const char* path) { @@ -39,7 +56,7 @@ int create_shm(const char* path) if (key == -1) return -1; - shmid = shmget(key, SHM_SIZE, 0644 | IPC_CREAT | IPC_EXCL); + shmid = shmget(key, shm_size, 0644 | IPC_CREAT | IPC_EXCL); if (shmid == -1) fprintf(stderr, "create_shm(%s)::shmget: %s\n", path, strerror(errno)); @@ -51,16 +68,27 @@ int create_shm(const char* path) int get_shm(const char* path) { key_t key; - int shmid = -1; + struct shmid_ds buf; + int shmid = -1, r; key = get_key(path); if (key == -1) return -1; shmid = shmget(key, 0, 0); - if (shmid == -1) + if (shmid == -1) { fprintf(stderr, "get_shm(%s)::shmget: %s\n", path, strerror(errno)); + return shmid; + } + + r = shmctl(shmid, IPC_STAT, &buf); + if (r) { + fprintf(stderr, "get_shm(%s)::shmctl: %s\n", path, + strerror(errno)); + return r; + } + shm_size = buf.shm_segsz; return shmid; } @@ -89,6 +117,9 @@ void print_usage(const char* cmd) printf("%s -c\"message\" /path/to/shm:" " initialiaze a shm\n", cmd); + printf("%s -C\"/path/to/file/containing/message\" /path/to/shm:" + " initialiaze a shm\n", cmd); + printf("%s -d {/path/to/shm | -i <shmid>}:" " delete a shm\n", cmd); @@ -98,6 +129,9 @@ void print_usage(const char* cmd) printf("%s -w\"message\" {/path/to/shm | -i <shmid>}:" " write to a shm\n", cmd); + + printf("%s -W\"/path/to/file/containing/message\" {/path/to/shm | -i <shmid>}:" + " write to a shm\n", cmd); } void parse_args(int argc, char *argv[]) @@ -106,12 +140,13 @@ void parse_args(int argc, char *argv[]) while (1) { - c = getopt(argc, argv, "c:w:r:diqh"); + c = getopt(argc, argv, "c:C:w:W:r:diqh"); if (c == -1) break; switch (c) { case 'r': + action = READ; nb_loops = atoi(optarg); if (nb_loops <= 0) { fprintf(stderr, "Invalid value for -r options\n"); @@ -119,14 +154,24 @@ void parse_args(int argc, char *argv[]) } break; case 'c': - create = 1; - strncpy(msg, optarg, SHM_SIZE); + action = CREATE; + shm_size = strlen(optarg)+1; + msg = optarg; + break; + case 'C': + action = CREATE_FROM_FILE; + path_msg = optarg; break; case 'w': - strncpy(msg, optarg, SHM_SIZE); + action = WRITE; + msg = optarg; + break; + case 'W': + action = WRITE_FROM_FILE; + path_msg = optarg; break; case 'd': - create = -1; + action = DELETE; break; case 'i': use_id = 1; @@ -157,7 +202,7 @@ void print_msg(const char *format, ...) int main(int argc, char* argv[]) { - int shmid; + int shmid, r; char *data; if (argc < 3) { @@ -167,43 +212,81 @@ int main(int argc, char* argv[]) parse_args(argc, argv); - if (use_id && create == 1) { - fprintf(stderr, "** incompatible options used: -c and -i\n"); + if (action == NONE) { + print_usage(argv[0]); exit(EXIT_FAILURE); } - if (create == 1) { - shmid = create_shm(argv[argc-1]); - } else { + if (action == CREATE || action == CREATE_FROM_FILE) { + if (use_id) { - shmid = atoi(argv[argc-1]); - } else { - shmid = get_shm(argv[argc-1]); + fprintf(stderr, "** incompatible options used: -c|-C and -i\n"); + exit(EXIT_FAILURE); } - if (create == -1) { /* user wants to remove the SHM object */ - int r; - r = delete_shm(shmid); - if (r) + if (action == CREATE) + shm_size = strlen(msg) + 1; + else { + /* CREATE_FROM_FILE */ + struct stat buf; + r = stat(path_msg, &buf); + if (r) { + perror("stat"); exit(EXIT_FAILURE); - - exit(EXIT_SUCCESS); + } + shm_size = buf.st_size; + print_msg("%d: size: %zd\n", shmid, shm_size); } + + shmid = create_shm(argv[argc-1]); + + } else if (use_id) { + shmid = atoi(argv[argc-1]); + } else { + shmid = get_shm(argv[argc-1]); } if (shmid == -1) exit(EXIT_FAILURE); + if (action == DELETE) { + r = delete_shm(shmid); + if (r) + exit(EXIT_FAILURE); + exit(EXIT_SUCCESS); + } + data = shmat(shmid, (void *)0, 0); if (data == (char *)(-1)) { perror("shmat"); exit(EXIT_FAILURE); } - if (nb_loops == 0) { - strncpy(data, msg, SHM_SIZE); + if (action == CREATE || action == WRITE) { + memcpy(data, msg, shm_size); print_msg("%d:%s\n", shmid, msg); + } else if (action == CREATE_FROM_FILE || action == WRITE_FROM_FILE) { + r = open(path_msg, O_RDONLY); + if (r == -1) { + perror("open"); + exit(EXIT_FAILURE); + } + + msg = mmap(NULL, shm_size, PROT_READ, MAP_PRIVATE, r, 0); + if (msg == MAP_FAILED) { + perror("mmap"); + exit(EXIT_FAILURE); + } + + memcpy(data, msg, shm_size); + + munmap(msg, shm_size); + + close(r); + + print_msg("%d:%s\n", shmid, data); } else { + /* action == READ */ int i; for (i = 0; i < nb_loops; i++) { @@ -213,11 +296,12 @@ int main(int argc, char* argv[]) do_one_loop(i, &n); #ifdef KTP_TEST if (strncmp(data, "KTP REQ CHANGE", 15) == 0) - strncpy(data, "KTP CHANGE DONE", SHM_SIZE); + strncpy(data, "KTP CHANGE DONE", shm_size); #endif } } + if (shmdt(data) == -1) { perror("shmdt"); exit(EXIT_FAILURE); commit d9d5afc71b4843398348ed39e1261e0971a967ab Author: Matthieu Fertré <mat...@ke...> Date: Mon Jun 7 14:48:04 2010 +0200 [KTP] Let cr_ipc_shm* store fixed size content in SHM diff --git a/tests/ktp/cr/cr_ipc_shm01 b/tests/ktp/cr/cr_ipc_shm01 index 42ba971..3c4ffa2 100644 --- a/tests/ktp/cr/cr_ipc_shm01 +++ b/tests/ktp/cr/cr_ipc_shm01 @@ -35,7 +35,7 @@ cr_ipc_shm01() TST_COUNT=$[$TST_COUNT+1] # Test case number. local shmpath=`mktemp -d` - local written_msg="$RANDOM" + local written_msg=`generate_fixed_size_random_msg` # create the shm and get its identifier create_sysv_shm $shmpath $written_msg || return $? @@ -59,14 +59,14 @@ cr_ipc_shm01() check_sysv_shm_value $SHMID $shmpath "$written_msg" || return $? - written_msg="$RANDOM" + written_msg=`generate_fixed_size_random_msg` write_sysv_shm_value $SHMID $shmpath "$written_msg" || return $? check_sysv_shm_value $SHMID $shmpath "$written_msg" || return $? dump_sysv_shm $SHMID $shmpath $shmpath/shm_v2.bin || return $? - written_msg="$RANDOM" + written_msg=`generate_fixed_size_random_msg` write_sysv_shm_value $SHMID $shmpath "$written_msg" || return $? dump_sysv_shm $SHMID $shmpath $shmpath/shm_v3.bin || return $? diff --git a/tests/ktp/cr/cr_ipc_shm02 b/tests/ktp/cr/cr_ipc_shm02 index d63ed36..cb0b4d5 100644 --- a/tests/ktp/cr/cr_ipc_shm02 +++ b/tests/ktp/cr/cr_ipc_shm02 @@ -38,7 +38,7 @@ cr_ipc_shm02() TST_COUNT=$[$TST_COUNT+1] # Test case number. # create the shm and get its identifier - local written_msg="$RANDOM" + local written_msg=`generate_fixed_size_random_msg` local shmpath=`mktemp -d` create_sysv_shm $shmpath $written_msg || return $? diff --git a/tests/ktp/cr/lib_cr_ipc.sh b/tests/ktp/cr/lib_cr_ipc.sh index db68ef7..864a8e6 100644 --- a/tests/ktp/cr/lib_cr_ipc.sh +++ b/tests/ktp/cr/lib_cr_ipc.sh @@ -60,6 +60,17 @@ wait_other_instances() # SYSTEM V SHM ########################################################################### +generate_fixed_size_random_msg() +{ + local length=10 + local msg="" + for i in `seq 1 $length`; do + msg="$RANDOM$msg" + done + msg=`echo $msg|cut -b 10` + echo $msg +} + create_sysv_shm() { local shm_path=$1 commit b2df163bc1676cb814135930aa092dd385f9dec9 Author: Matthieu Fertré <mat...@ke...> Date: Fri Jun 4 15:22:59 2010 +0200 [KTP] C/R: add test checking behavior of freeze/unfreeze diff --git a/tests/ktp/cr/Makefile.am b/tests/ktp/cr/Makefile.am index bb5d9e6..98a5a50 100644 --- a/tests/ktp/cr/Makefile.am +++ b/tests/ktp/cr/Makefile.am @@ -36,6 +36,7 @@ tests_SCRIPTS = \ cr_clone_files01 \ cr_clone_fs01 \ cr_clone_semundo01 \ + cr_freeze_unfreeze \ cr_stress \ cr_tree01 \ cr_tree02 \ diff --git a/tests/ktp/cr/cr_freeze_unfreeze b/tests/ktp/cr/cr_freeze_unfreeze new file mode 100644 index 0000000..102702f --- /dev/null +++ b/tests/ktp/cr/cr_freeze_unfreeze @@ -0,0 +1,86 @@ +#!/bin/bash +############################################################################### +## +## Copyright (c) Kerlabs, 2010 +## +## This program is free software; you can redistribute it and#or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +## for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +## +############################################################################### +# +# Description: Test program for Kerrighed checkpoint with options to freeze +# unfreeze, and checkpoint process. +# +# Author: Matthieu Fertré, mat...@ke... +# + +source `dirname $0`/lib_cr.sh + +description="Freeze/unfreeze: Run, F, U, F, C, U, F, C, C, U, F, F(fail), U, U(fail)..." + +cr_freeze_unfreeze() +{ + TCID="$FUNCNAME" # Identifier of this testcase. + TST_COUNT=$[$TST_COUNT+1] # Test case number. + + runcommand +CHECKPOINTABLE || return $? + + freeze_process $PID $TESTCMD || return $? + + unfreeze_process $PID $TESTCMD || return $? + + + freeze_process $PID $TESTCMD || return $? + + checkpoint_frozen_process $PID $TESTCMD || return $? + + unfreeze_process $PID $TESTCMD || return $? + + + freeze_process $PID $TESTCMD || return $? + + checkpoint_frozen_process $PID $TESTCMD || return $? + + checkpoint_frozen_process $PID $TESTCMD || return $? + + unfreeze_process $PID $TESTCMD || return $? + + + freeze_process $PID $TESTCMD || return $? + + freeze_process_must_fail $PID $TESTCMD || return $? + + unfreeze_process $PID $TESTCMD || return $? + + unfreeze_process_must_fail $PID $TESTCMD || return $? + + checkpoint_frozen_process_must_fail $PID $TESTCMD || return $? + + + freeze_process $PID $TESTCMD || return $? + + checkpoint_process_must_fail $PID $TESTCMD || return $? + + unfreeze_process $PID $TESTCMD || return $? + + + kill_group $PID $TESTCMD || return $? + + print_success $? + return $? +} + +CR_setup $@ || exit $? + +cr_freeze_unfreeze || exit $? diff --git a/tests/ktp/cr/lib_cr.sh b/tests/ktp/cr/lib_cr.sh index af74ceb..c498863 100755 --- a/tests/ktp/cr/lib_cr.sh +++ b/tests/ktp/cr/lib_cr.sh @@ -207,7 +207,6 @@ checkpoint_process_must_fail() return $r } - freeze_process() { local _pid=$1 @@ -228,6 +227,29 @@ freeze_process() return $r } +freeze_process_must_fail() +{ + local _pid=$1 + local _name=$2 + local r=0 + + checkpoint -f $_pid > /dev/null 2>&1 + + r=$? + if [ $r -eq 0 ]; then + tst_brkm TFAIL NULL \ + "freeze_process_must_fail: freeze process $_pid ($_name) should have failed" + r=1 + return $r + fi + + LTP_print_step_info \ + "freeze_must_fail: PID: $_pid, error: $r" + + r=0 + return $r +} + checkpoint_frozen_process() { local _pid=$1 @@ -256,6 +278,27 @@ checkpoint_frozen_process() return $r } +checkpoint_frozen_process_must_fail() +{ + local _pid=$1 + local _name=$2 + local r=0 + + checkpoint -c $_pid > /tmp/chkpt_result${_pid} 2>&1 + + r=$? + if [ $r -eq 0 ]; then + tst_brkm TFAIL NULL "checkpoint_frozen_must_fail: checkpoint $_pid ($_name) should have failed" + r = 1 + return $r + fi + + LTP_print_step_info \ + "checkpoint_frozen_must_fail: PID: $_pid, error: $r" + + r=0 + return $r +} unfreeze_process() { @@ -277,6 +320,29 @@ unfreeze_process() return $r } +unfreeze_process_must_fail() +{ + local _pid=$1 + local _name=$2 + local r=0 + + checkpoint -u $_pid > /dev/null 2>&1 + + r=$? + if [ $r -eq 0 ]; then + tst_brkm TFAIL NULL \ + "unfreeze_process_must_fail: unfreeze process $_pid ($_name) should have failed" + r=1 + return $r + fi + + LTP_print_step_info \ + "unfreeze_must_fail: PID: $_pid, error: $r" + + r=0 + return $r +} + ############################################################################### check_group_exists_in_ps() diff --git a/tests/ktp/krgltp-smp.sh.in b/tests/ktp/krgltp-smp.sh.in index 3d4d484..d067bf2 100755 --- a/tests/ktp/krgltp-smp.sh.in +++ b/tests/ktp/krgltp-smp.sh.in @@ -1709,6 +1709,7 @@ rsingle cr21 rsingle cr22 rsingle cr23 rsingle cr24 +r cr_freeze_unfreeze r cr_abort01 r cr_abort02 r cr_tree01 commit e8b99d2e2ae420580d027ae832d38877472bab06 Author: Louis Rilling <lou...@ke...> Date: Wed May 26 18:00:43 2010 +0200 [BUGFIX] kerrighed.init: Only configure schedulers and add nodes on the boot node Commit b9386ae7c235c5b138b418a16b0f2374fd43e0a5 ([tools] Update init scripts for new cluster start method) broke the ability to configure things only on one node, probably because the former method to distinguish the boot node from the others stopped working. Fix this using another detection method for the boot node: only the boot node should see only 1 online node. Note: with hot node remove this method will remain reliable, as long as 1) no node tries to remove other nodes before calling kerrighed.init locally, 2) and no node automatically removes itself by killing its Kerrighed container's init (from the host system). Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tools/kerrighed.init b/tools/kerrighed.init index c4b2754..a655f93 100755 --- a/tools/kerrighed.init +++ b/tools/kerrighed.init @@ -44,6 +44,13 @@ d_check_kerrighed() { return $? } +# +# Check if running on the boot node of the cluster, before adding other nodes +# +d_check_boot_node() { + [ "`krgadm nodes | grep -c online`" = "1" ] +} + d_start_scheduler() { log_progress_msg "scheduler" @@ -69,10 +76,14 @@ d_start_scheduler() { d_start() { log_daemon_msg "Starting $DESC" - d_start_scheduler || STATUS=1 - if [ -n "$ADD_OPTS" ]; then - log_progress_msg "nodes" - krgadm nodes add $ADD_OPTS > /dev/null || STATUS=1 + if d_check_boot_node; then + log_progress_msg "boot node" + + d_start_scheduler || STATUS=1 + if [ -n "$ADD_OPTS" ]; then + log_progress_msg "nodes" + krgadm nodes add $ADD_OPTS > /dev/null || STATUS=1 + fi fi log_end_msg ${STATUS:-0} commit b7bab9834b1026b860e9cd8944dca5eee4eac5a4 Author: Louis Rilling <lou...@ke...> Date: Wed Jun 2 13:19:14 2010 +0200 kerrighed.init: Fix misuse of log_daemon_msg Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tools/kerrighed.init b/tools/kerrighed.init index c73055b..c4b2754 100755 --- a/tools/kerrighed.init +++ b/tools/kerrighed.init @@ -71,7 +71,7 @@ d_start() { d_start_scheduler || STATUS=1 if [ -n "$ADD_OPTS" ]; then - log_daemon_msg "nodes" + log_progress_msg "nodes" krgadm nodes add $ADD_OPTS > /dev/null || STATUS=1 fi commit 139891819f6376cbf419372a0d830301c2f8a308 Author: Louis Rilling <lou...@ke...> Date: Wed May 26 17:48:56 2010 +0200 [BUGFIX] kerrighed.init: Fix error reporting And control better when to exit. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tools/kerrighed.init b/tools/kerrighed.init index c20f586..c73055b 100755 --- a/tools/kerrighed.init +++ b/tools/kerrighed.init @@ -20,8 +20,6 @@ # Description: Kerrighed services ### END INIT INFO -set -e - PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin NAME=kerrighed @@ -52,17 +50,17 @@ d_start_scheduler() { case "x$LEGACY_SCHED" in xtrue) krg_legacy_scheduler > /dev/null 2>&1 + return $? ;; xfalse) log_progress_msg "disabled in $CFG" + return 0 ;; *) log_progress_msg "value of LEGACY_SCHED in $CFG must be either 'true' or 'false'" - STATUS=1 + return 1 ;; esac - - return ${STATUS:-0} } # @@ -71,11 +69,10 @@ d_start_scheduler() { d_start() { log_daemon_msg "Starting $DESC" - d_start_scheduler + d_start_scheduler || STATUS=1 if [ -n "$ADD_OPTS" ]; then log_daemon_msg "nodes" - krgadm nodes add $ADD_OPTS > /dev/null - : ${STATUS:=$?} + krgadm nodes add $ADD_OPTS > /dev/null || STATUS=1 fi log_end_msg ${STATUS:-0} commit a3b15b48fc3af345b7fc90bcfaf020d1cdb07436 Author: Louis Rilling <lou...@ke...> Date: Tue Jun 1 18:32:10 2010 +0200 [JANITOR] kerrighed-host.init: cleanup error reporting And kill insane set -e. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tools-host/kerrighed-host.init b/tools-host/kerrighed-host.init index 26a0ee3..a814558 100755 --- a/tools-host/kerrighed-host.init +++ b/tools-host/kerrighed-host.init @@ -19,8 +19,6 @@ # Description: Initialize the Kerrighed container ### END INIT INFO -set -e - PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin NAME=kerrighed-host @@ -41,7 +39,6 @@ fi # d_check_kerrighed() { test -d /sys/kerrighed - return $? } # @@ -49,9 +46,6 @@ d_check_kerrighed() { # d_start_container() { krgboot_helper - ret=$? - - return $ret } # @@ -93,7 +87,9 @@ d_start() { if test "$(cat /sys/kerrighed/node_id)" = "$BOOT_ID"; then log_progress_msg "container" - if ! d_start_container; then + if [ "$STATUS" = "1" ]; then + log_progress_msg "not starting due to previous errors" + elif ! d_start_container; then log_progress_msg "(failed)"; STATUS=1 fi fi commit a1ea6fddea71c76f2e60ce627f382684d5079c9b Author: Alexandre Lissy <ale...@et...> Date: Tue Jun 1 18:24:48 2010 +0200 Syntax error in kerrighed-host script This fixes the following syntax error present in the init.d/kerrighed-host script : /etc/init.d/kerrighed-host status Kerrighed host status:/etc/init.d/kerrighed-host: 175: 0: not found Signed-off-by: Alexandre Lissy <ale...@et...> diff --git a/tools-host/kerrighed-host.init b/tools-host/kerrighed-host.init index 35b9e33..26a0ee3 100755 --- a/tools-host/kerrighed-host.init +++ b/tools-host/kerrighed-host.init @@ -133,7 +133,7 @@ d_stop() { d_status() { d_check_kerrighed ret=$? - if $ret; then + if [ $ret -eq 0 ]; then log_progress_msg "running Kerrighed kernel" else log_progress_msg "not running Kerrighed kernel" commit 4100459b5a1dd9e3d25119776e70966690b19d80 Author: Louis Rilling <lou...@ke...> Date: Tue Jun 1 18:33:19 2010 +0200 Revert "Fix typo in kerrighed-host.init" This reverts commit cc9129d5e1ae3da23a250f4044826d5e339daf49. The "fix" introduces another bug that hides the real one. A later commit fixes the real bug. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tools-host/kerrighed-host.init b/tools-host/kerrighed-host.init index 6ecb2a9..35b9e33 100755 --- a/tools-host/kerrighed-host.init +++ b/tools-host/kerrighed-host.init @@ -141,7 +141,7 @@ d_status() { return $ret } -if ! [ d_check_kerrighed ]; then +if ! d_check_kerrighed; then log_failure_msg "Not running a Kerrighed kernel" exit 0 else commit cc9129d5e1ae3da23a250f4044826d5e339daf49 Author: Jean Parpaillon <jea...@ke...> Date: Mon May 31 09:59:45 2010 +0200 Fix typo in kerrighed-host.init Thanks to lissyx diff --git a/tools-host/kerrighed-host.init b/tools-host/kerrighed-host.init index 35b9e33..6ecb2a9 100755 --- a/tools-host/kerrighed-host.init +++ b/tools-host/kerrighed-host.init @@ -141,7 +141,7 @@ d_status() { return $ret } -if ! d_check_kerrighed; then +if ! [ d_check_kerrighed ]; then log_failure_msg "Not running a Kerrighed kernel" exit 0 else commit 28dac08c8128d91eb33142051076e5be6579783f Author: Jean Parpaillon <jea...@ke...> Date: Thu May 27 16:30:38 2010 +0200 Improve version generation in configure.ac diff --git a/configure.ac b/configure.ac index 18d3006..4a88d81 100644 --- a/configure.ac +++ b/configure.ac @@ -9,8 +9,9 @@ dnl autoconf version AC_PREREQ(2.59) dnl mandatory stuff -define([gitversion], esyscmd([sh -c "which git > /dev/null && git describe | sed -e 's/kerrighed-\([^-]\+\)//' | tr -d '\n' || true"]))dnl -AC_INIT([Kerrighed], [3.0rc1]gitversion, [ker...@ir...]) +define([project], [kerrighed]) +define([gitversion], esyscmd([sh -c "which git > /dev/null && git describe | sed -e 's/]project[-\([^-]\+\)//' | tr -d '\n' || true"]))dnl +AC_INIT(project, [3.0rc1]gitversion, [ker...@ir...]) AC_DEFINE(GITVERSION, "gitversion", [GIT version]) dnl check host and target commit e31870a1c90b14bd93bb5d7dd4b3dbad8db21838 Author: Jean Parpaillon <jea...@ke...> Date: Thu May 27 11:57:19 2010 +0200 Fix version generation in configure.ac diff --git a/configure.ac b/configure.ac index c8f0f1e..18d3006 100644 --- a/configure.ac +++ b/configure.ac @@ -10,7 +10,7 @@ AC_PREREQ(2.59) dnl mandatory stuff define([gitversion], esyscmd([sh -c "which git > /dev/null && git describe | sed -e 's/kerrighed-\([^-]\+\)//' | tr -d '\n' || true"]))dnl -AC_INIT([Kerrighed], [3.0-rc1gitversion], [ker...@ir...]) +AC_INIT([Kerrighed], [3.0rc1]gitversion, [ker...@ir...]) AC_DEFINE(GITVERSION, "gitversion", [GIT version]) dnl check host and target commit 76e477595b08b7ab285695b26da33b5eda2b5633 Author: Jean Parpaillon <jea...@ke...> Date: Fri May 21 17:10:09 2010 +0200 Allow linux_version.sh script to be run from any directory diff --git a/linux_version.sh b/linux_version.sh index 122fabe..13401cd 100755 --- a/linux_version.sh +++ b/linux_version.sh @@ -1,3 +1,3 @@ #!/bin/sh -sed '/^vanilla_linux_version/!d; s/.*vanilla_linux_version=//' configure.ac +sed '/^vanilla_linux_version/!d; s/.*vanilla_linux_version=//' $(dirname $0)/configure.ac commit 3cd29a62d1a9add320d76f7ed40d7260a2d4656c Author: Jean Parpaillon <jea...@ke...> Date: Fri May 21 16:20:15 2010 +0200 Update version to 3.0rc1 diff --git a/configure.ac b/configure.ac index 7682b0a..c8f0f1e 100644 --- a/configure.ac +++ b/configure.ac @@ -10,7 +10,7 @@ AC_PREREQ(2.59) dnl mandatory stuff define([gitversion], esyscmd([sh -c "which git > /dev/null && git describe | sed -e 's/kerrighed-\([^-]\+\)//' | tr -d '\n' || true"]))dnl -AC_INIT([Kerrighed], [3.0gitversion], [ker...@ir...]) +AC_INIT([Kerrighed], [3.0-rc1gitversion], [ker...@ir...]) AC_DEFINE(GITVERSION, "gitversion", [GIT version]) dnl check host and target commit 7d49161efa05bef0b2ddb516502b6f6e27ffe831 Author: Jean Parpaillon <jea...@ke...> Date: Tue May 18 09:33:34 2010 +0200 [minor] Fix krg_check_* functions to follow C conventions Thanks to Matthieu's comments diff --git a/libs/include/hotplug.h b/libs/include/hotplug.h index 94ff078..cdc7984 100644 --- a/libs/include/hotplug.h +++ b/libs/include/hotplug.h @@ -38,7 +38,7 @@ int krg_hotplug_init(void); * * Check if we are in a running Kerrighed container * - * Return 0 if ok, 1 otherwise + * Return 0 if ok, -1 otherwise */ int krg_check_hotplug(void); @@ -47,7 +47,7 @@ int krg_check_hotplug(void); * * Check if Kerrighed container is already running * - * Return 0 if running, 1 otherwise + * Return 0 if running, -1 otherwise */ int krg_check_container(void); diff --git a/libs/include/proc.h b/libs/include/proc.h index 9e3ff7b..42f683a 100644 --- a/libs/include/proc.h +++ b/libs/include/proc.h @@ -14,7 +14,7 @@ * * Check if kerrighed support checkpoint * - * Return 0 if ok, 1 otherwise + * Return 0 if ok, -1 otherwise */ int krg_check_checkpoint(void); diff --git a/libs/libkerrighed/libhotplug.c b/libs/libkerrighed/libhotplug.c index cd5d404..80e09a9 100644 --- a/libs/libkerrighed/libhotplug.c +++ b/libs/libkerrighed/libhotplug.c @@ -367,7 +367,7 @@ int krg_check_hotplug(void) r = call_kerrighed_services(KSYS_GET_NODE_ID, &node_id); if (r != 0) { errno = EAGAIN; - return 1; + return -1; } return 0; @@ -378,7 +378,7 @@ int krg_check_container(void) struct stat buf; if ( stat("/proc/nodes/self", &buf) != 0 ) { - return 1; + return -1; } return 0; diff --git a/libs/libkerrighed/libproc.c b/libs/libkerrighed/libproc.c index 5a5d2a9..b25ff2c 100644 --- a/libs/libkerrighed/libproc.c +++ b/libs/libkerrighed/libproc.c @@ -34,7 +34,7 @@ int krg_check_checkpoint(void) status = stat(CHKPT_DIR, &buffer); if (status) { errno = ENOENT; - return 1; + return -1; } return 0; diff --git a/tools-host/krgboot.c b/tools-host/krgboot.c index 088541d..ab8152a 100644 --- a/tools-host/krgboot.c +++ b/tools-host/krgboot.c @@ -119,13 +119,15 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } - if (!krg_check_hotplug()) { + ret = krg_check_hotplug(); + if (!ret) { fprintf(stderr, "Must be run from root container only\n"); exit(EXIT_FAILURE); } - if (!krg_check_container()) { + ret = krg_check_container(); + if (!ret) { fprintf(stderr, "Kerrighed container is already running\n"); exit(EXIT_FAILURE); diff --git a/tools/checkpoint.c b/tools/checkpoint.c index 546bdc9..e869095 100644 --- a/tools/checkpoint.c +++ b/tools/checkpoint.c @@ -142,15 +142,19 @@ void parse_args(int argc, char *argv[]) void check_environment(void) { + int ret; + /* is Kerrighed launched ? */ - if (krg_check_hotplug()) + ret = krg_check_hotplug(); + if (ret) { perror("Kerrighed is not started"); exit(EXIT_FAILURE); } /* Is checkpoint available ? */ - if (krg_check_checkpoint()) { + ret = krg_check_checkpoint(); + if (ret) { perror("Checkpointing is not available"); exit(EXIT_FAILURE); } diff --git a/tools/krgadm.c b/tools/krgadm.c index 6e28790..36f490f 100644 --- a/tools/krgadm.c +++ b/tools/krgadm.c @@ -534,7 +534,8 @@ int cluster(int argc, char* argv[], char* program_name) int ret = EXIT_SUCCESS; int r; - if ( krg_check_hotplug() ) { + r = krg_check_hotplug(); + if (r) { perror("Kerrighed is not running"); return EXIT_FAILURE; } @@ -612,8 +613,10 @@ int nodes(int argc, char* argv[], char* program_name) enum mode_t mode = NODES_MODE_UNSET; int nb_nodes = -1; int action = NONE; + int ret; - if ( krg_check_hotplug() ) { + ret = krg_check_hotplug(); + if (ret) { perror("Kerrighed is not running"); return EXIT_FAILURE; } commit 08a4ca7ad0b2eb4cfea69676ec8b08598da47e20 Author: Louis Rilling <lou...@ke...> Date: Thu May 20 15:37:05 2010 +0200 [KTP] Tag waitid02 as rcrash and detail the problem Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tests/ktp/krgltp-smp.sh.in b/tests/ktp/krgltp-smp.sh.in index 0f31920..3d4d484 100755 --- a/tests/ktp/krgltp-smp.sh.in +++ b/tests/ktp/krgltp-smp.sh.in @@ -1667,7 +1667,9 @@ rcrash waitpid13 # User level dead-lock ############################ Waitid r waitid01 -rfail waitid02 # Unknown issue. +rcrash waitid02 # User level dead-lock + # WSTOPPED and WCONTINUED not supported for remote + # children ############################ Write commit 45c36eed1382491b832d098ab0d96dd8525bc260 Author: Louis Rilling <lou...@ke...> Date: Thu May 20 12:31:00 2010 +0200 [BUGFIX] kerrighed.init: Fix partial scheduler configuration Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tools/kerrighed.init b/tools/kerrighed.init index bdf1795..c20f586 100755 --- a/tools/kerrighed.init +++ b/tools/kerrighed.init @@ -71,12 +71,12 @@ d_start_scheduler() { d_start() { log_daemon_msg "Starting $DESC" + d_start_scheduler if [ -n "$ADD_OPTS" ]; then log_daemon_msg "nodes" krgadm nodes add $ADD_OPTS > /dev/null - STATUS=$? + : ${STATUS:=$?} fi - d_start_scheduler log_end_msg ${STATUS:-0} return $? ----------------------------------------------------------------------- Summary of changes: ChangeLog | 3 + configure.ac | 5 +- libs/include/hotplug.h | 4 +- libs/include/proc.h | 2 +- libs/libkerrighed/libhotplug.c | 4 +- libs/libkerrighed/libproc.c | 14 -- linux_version.sh | 2 +- man/restart.1.xml | 11 ++ scripts/compile-tools | 2 +- tests/apps/Makefile.am | 2 - tests/apps/ipcshm-tool.c | 142 ++++++++++++++++---- tests/ktp/cr/Makefile.am | 8 +- tests/ktp/cr/{cr_pipe01 => cr_blender} | 48 +++++-- tests/ktp/cr/{cr_ipc_shm02 => cr_freeze_unfreeze} | 59 ++++----- tests/ktp/cr/cr_ipc_shm01 | 6 +- tests/ktp/cr/cr_ipc_shm02 | 2 +- tests/ktp/cr/duck11_peaking.blend | Bin 0 -> 1093188 bytes tests/ktp/cr/duck11_peaking_render_1.png | Bin 0 -> 312493 bytes tests/ktp/cr/lib_cr.sh | 100 ++++++++++++++- tests/ktp/cr/lib_cr_ipc.sh | 11 ++ tests/ktp/krgltp-smp.sh.in | 5 +- tools-host/kerrighed-host.init | 12 +- tools-host/krgboot.c | 6 +- tools/Makefile.am | 4 +- tools/checkpoint.c | 66 +++++++++- tools/kerrighed.init | 28 +++-- tools/krgadm.c | 7 +- tools/restart.c | 54 +++++--- 28 files changed, 446 insertions(+), 161 deletions(-) copy tests/ktp/cr/{cr_pipe01 => cr_blender} (56%) copy tests/ktp/cr/{cr_ipc_shm02 => cr_freeze_unfreeze} (52%) create mode 100644 tests/ktp/cr/duck11_peaking.blend create mode 100644 tests/ktp/cr/duck11_peaking_render_1.png hooks/post-receive -- UNNAMED PROJECT |
From: alebre <al...@us...> - 2010-07-16 17:58:00
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "kdfs". The branch, make_kdfs_compile has been updated via 0a5fafb4d704c3289c4098cd1f0630a73ad763bf (commit) via ba273f9d120a368e9695820f4a5ec870733c81e4 (commit) via 3bbbed7a4f4e8a8b1004f461a5f0ba04ab12be9e (commit) via 090f74bf5431caa5d6a8185de22341ec77eafc5e (commit) via 8b0bb79523c616e2aa8fd416f79cb73565010619 (commit) via 3b8fb32c231e5f80316411e2bb13f5360f49b6c6 (commit) via 5c596a74126b55d39d13d692df8a24ce1c3dd036 (commit) via e15f87760a1dccc6c616ade8bb2f421869e4482d (commit) via 9383856e21bc97dbfb77238eb74191ab0547ece0 (commit) via 9113791a3242de6969a7f67296c7f8fae3ef26f7 (commit) via 16b4cb4ebff0d9a88d6d7dbb2a3ecee89fa68c48 (commit) via 2d39f2f748e1eea9336b7145575b9d125339beac (commit) via 0f2e8ee95482b45bb8ac00b83b0bd4c6dc057d9b (commit) via 5dff30da37d4a3025802574679d0ba8407d1a2c1 (commit) via c229cdad8e5fe9bd57a49fe6148b291fef354f91 (commit) via c1d31811d9e4b1358230542f67458ee87ec5547b (commit) via 8c7474f07d53cc2468aee4f8f5dc095960ac6fe6 (commit) via c3c276eeb89104372f379225d2ffad63c43301c1 (commit) via f005d8966ce2d525c3fa2aa8e59c25b4eb05271e (commit) via f1eec05cb5d153ca139c9071d8fd7489dbc500fe (commit) via cdc1332343c70b215f485c029a6e75d5c0442cd9 (commit) via 4193891fb73aa4543d6db50bf960b53c1c780dbd (commit) via 4df2c21c5af6595909dc24f9d28c09c1dee842c2 (commit) via a270cd2ca7216f8ca5a6227c0cdd4fb908582146 (commit) via f041999d4dc815719b22495e0656457991f96928 (commit) via 9da633cb78e774b493b1ec4cc4fb31e9c8ca1a68 (commit) via 674937a9434df52deb13edfa6051430d5bf4c067 (commit) via 32588b71ad2ee3ae8826c60ea4b91a36019fa72b (commit) via 7b8a6c6a8a542f97a13f1c5c0018cf5457d02c70 (commit) via beb6b202b243e76386f8853d784c4e8e166de6b2 (commit) via e757e2229a2ee28687e87dba352a2f475f45f39d (commit) via e3930cbdc732d9340f648b07fa4294955bf0c685 (commit) via bd19c359594fd42e376f0d6f03dd246c79903bd9 (commit) via c1bf78d3d880bbba980b029b7367294934ff8fb2 (commit) via c6e8959712da37c7a89382fdecb164f4351e5574 (commit) via f40bc6b2ec214e684b1ac6b616c0504b3fe3e409 (commit) via f5f70e81c1ffae2b4c8839f326e20041a9016842 (commit) via c3cc4a43ef75bb6d23de18726c6edc40d3c7f230 (commit) via 219fc8ed624a922e3c92ebeeace31c7576bab42d (commit) via 2f092f4723372a44a9e4eb6eb6e109bd2b35438d (commit) via 7b5fbb42c65ee3c568f678732f8d9dc8fce61488 (commit) via a40da323cee09a81248f39f13d9c147323fab698 (commit) via ef8926360c63835a5de166fd19459667cd466ac6 (commit) via 218ee6af320ff06a219aed78d5ded00b346649f3 (commit) via 0c5796cd12341f34f432bf7c591db534836d1678 (commit) via 44db85eabdab32970f594977ea67691d6bc7b81b (commit) via e5c85337231900ab685094a473e82262ebad8822 (commit) via 6a7b45bf5e2563d2bbb3292b051cb7bc330266f9 (commit) via 172f87e793f2fd8113aba2737d2398e2c6ec2606 (commit) via 3ebf1fe76829048c780b50ea97a3e3681be7edcf (commit) via 0c33cbb63453a214e6765045e6c65acfb370971f (commit) via 93509461baa098a86f437c529b8d51eb899a9cb1 (commit) via 9edb056255f3b1f6e9679921103c938c6dd92b38 (commit) via 7bf2b7a3da2d6c06da3fbb59815ff54984f21b34 (commit) via b93c8d0a68d718b47c8d4b6087ca29f60186cd1a (commit) via d9b2ed8089a8cb29b47e6b045f261c11f01ea83f (commit) via 5aefddd62d71d816d73d52ad5cab812bd883cfe1 (commit) via 99661928dfd3d98f3dfbe1c6da14e9c43a399e66 (commit) via 52e8c8c8ac043e6bc72600c53520d5768b0d5838 (commit) via 6fef4a7d75ddb477f4a14aed2dfdc67ec667f608 (commit) via 2600a0a96c451049a4f565c5bf0d12d09099ef4e (commit) via a799f46fd811889edb53d5d979198322b5bfedfd (commit) via 6fd70409dfe3cfebc73fe9d8c132accdb761733d (commit) via b9383e5a4c18ac45d353aedf3885e9076ae2a08e (commit) via a81c21cf4d379a0ad00fd6e45aa365204734b948 (commit) via 360e45920da5d9091b0ad01d0870b77a5e84ec2f (commit) via a257353c0dd31dcfc58625010629933ce9a28556 (commit) via 4d7e232a957aa9d3cfb101edda7f9305ae6e6523 (commit) via 935c1efa04d725d406381c6bee88987c1ba5f298 (commit) via 420e630822240878afa0a8e42ad8c5c32f54b95a (commit) via 3ae242096a4ba25912707ac1f8ea195d43dd31f5 (commit) via aadc28a44a96d150c029879dff9e7c4d2b9d367e (commit) via 0593ba2fd498f108752d838c8845fa345abf132a (commit) via 7e6bdd1980ff369bd80930078a78ffa5c72258b3 (commit) via 9d4fe024182089b94a75e6a69ec404d29c6d2767 (commit) via b6621ca22cc6f7ff554d9ada81be85d136ee2a15 (commit) via 67001dd033f11cd794b699280d3a0cb82eebc893 (commit) via dc4ec7bcf3acbca9928025c7046d2e9a492f3d7e (commit) via 92c06b7e5e2cdfb260de29a203907103a3fd37b8 (commit) via 99b45125e6bfc2d759c4697a659b383f31c174a9 (commit) via fb2330856d0d1a3b436d9b3720014cd566433bcc (commit) via f1b6d7667ab7d3c85cc4537a9e952bea9fe5d4db (commit) via 252dcef418bae5e0855cc9012ddef72d6c5789bc (commit) via 0a797ad01da3fb016c920f61ceb2e50707594544 (commit) via 74afd5c76e54cefe0ad43ec1741a2ec703ec09e6 (commit) via c4db295659806df93e3739da508a53bd532e0c14 (commit) via c1d19dd7597d639d4c7768e1d48e4996c6ba7f72 (commit) via 69428ccc9f34330c9c3b35880336ea768c02d40b (commit) via d1ebe2dc902e01eb3776d4fc5a828327ed5d40e0 (commit) via 535a3ef59a5c6437bfaadfcf3691bf5b28da342b (commit) via 024219c54516b95e6797fcf291617a673f9f0dd5 (commit) via ddd6d62c99a23e3e5117a78e210b37242cd63ef4 (commit) via fb0a6ba846f4d769d71626f1a65854bef8dac9d4 (commit) via 9b5794a95d509fca027241a7e6ec7cccf73d991e (commit) via 37658e4e5c973f0e9850b696f888f567fb3ddb55 (commit) via b55dcc81a6024b08103b79cf8dc28356c5d9f910 (commit) via c4b2150c60ae55707cd2a473f551ee91f5c9a6cd (commit) via bc946ddf67a666bb98c7c0528d2fa9f3c7c5969b (commit) via 1b21814c4b646bfbb641e9fd405e4f272c7c7cd6 (commit) via 17c5d9e21fab9da5bce79947f9c17904c0b00ad3 (commit) via cf6706cb1d42bbd310e61345809ad091e6f62625 (commit) via e96a1902e77e81871355ebdfe9cd50e2894bc9e0 (commit) via b510be9352a7352a3e7a3775c64c98360092a4eb (commit) via f3983a31250908da9fcaff19aefa441a0a5660e1 (commit) via f0279e67f5440e6618096263a91889873ef6d0dd (commit) via ccb13eefef23a2de98f2f11169a90f5755920649 (commit) via aba92d2f1caad1ab2b5fed3fdf44ceca108cb932 (commit) via 9ee7e890fa9441451a5cf3f4b197b4bd8c4a2714 (commit) via ae83789f49803335d0e3b6942323d2b513f6557c (commit) via fc347c00bf4cc802b2690fb922061d206669c32c (commit) via 32da93685380eb387e69b20272acc37d5b15b0b9 (commit) via 59d25b545cec7c7cf66d1f9b59d488b223528119 (commit) via b3744b82edc36d4ee96c59fb50a7794dcb085d86 (commit) via 27c7ec4e77b3f66c7f9dc8fb8466164de34daa47 (commit) via da35ecf6f2523e43ba6b952d3564251b14da5139 (commit) via 08c279f543021658b698cce23945a18098eb2dc4 (commit) via 32c8b04b90a1346ab7f523cc1886b61da6ceceff (commit) via 00d49c44015e00ee7d2b42cda0049d0339630211 (commit) via 7a119509759dde9535a83a086b22bb0afd7a578b (commit) via 01eae2e9693e8767c3817993c1412e1bb54660f2 (commit) via 9013771e0b8bf3737b3d3680973b84734b68c6ef (commit) via dbfb34b0725ec62529e98a003fd2aeec2c463130 (commit) via 5cee4cd6ee4d566341833aba20e5c57f61b0eaa0 (commit) via 4dd5098c1271af15103ed0f4c4139f58ca92069e (commit) via 7977df55623f4d13c9e5a3773a7084e3075681d3 (commit) via f105a1fb13b132bb3220fe73f31b661db8a5c48a (commit) via c78b6c7cc44d0e9430d867650fcc4e462d4e0e54 (commit) via 6218efcd52b4c1aa952dec73fe49b71e45372b5a (commit) via 4198f62c2e9e1c7ffc2ad493fa57dfb2ebc4c2ae (commit) via 736df693434ca837fd7bfb19acfcc00d202775e4 (commit) from 09fd7d0746ec22a4e163188aebb7147fb8c61322 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 0a5fafb4d704c3289c4098cd1f0630a73ad763bf Author: ad <leb...@fr...> Date: Fri Jul 16 08:27:12 2010 +0000 Add dynamic debug into kDFS diff --git a/fs/kdfs/README b/fs/kdfs/README index 1a20771..9c7272b 100644 --- a/fs/kdfs/README +++ b/fs/kdfs/README @@ -139,6 +139,12 @@ struct kdfs_dir_entry { SUPERBLOCK MANAGEMENT: - - - - - - - - - - - - - - - - +A first KDDM set is used to manage each superblock clusterwide. Besides, kDFS +exploits a particular KDFS superblock that is in charge of maintaining which +nodes take part to the physical storage space. It consists of a simple bitmap. +This particular superblock is stored into the superblock KDDM set +(KDFS_SB_KDDM_ID) at the KDFS_CWSB_ID position (cf. super.h). + INODE MANAGEMENT: - - - - - - - - - - - - - - - - diff --git a/fs/kdfs/TODO b/fs/kdfs/TODO index 4aa4eaa..2c57e69 100644 --- a/fs/kdfs/TODO +++ b/fs/kdfs/TODO @@ -40,6 +40,7 @@ Prio. added added Type What 2 pierre 080227 bugfix check about obj_entry->lock (spinlock) being locked in kddm_io_invalidate_object when calling kdfs_iol_inode_invalidate_object (which calls a sleeping function) +2 adrien 100717 Bugfix check why we locally destroy the content kddm set the inode is dropped by the VFS (cfs. super.c kdfs_drop_inode) DONE ~~~~ diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index b7516c8..99331b6 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -79,6 +79,7 @@ int kdfs_readpage(struct file *file, struct page *page) struct kdfs_page *k_page = NULL; struct kdfs_inode *k_inode = NULL; + PRINT_FUNCTION_NAME; ASSERT(page != NULL); k_inode=kdfs_ilocalfind(page->mapping->host->i_ino); @@ -622,15 +623,16 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, /* The page can be already in the cache, especially when we dynamically change the default owner */ k_page->page = find_get_page(k_mapping, pageid); if (!k_page->page) { - DEBUG(DBG_TRACE, "Can't find page for file/directory = %ld and " \ - "page id = %ld, So created and locked\n", iolinker_data->ino, - pageid); k_page->page = find_or_create_page(k_mapping, pageid, (mapping_gfp_mask(k_mapping)|__GFP_ZERO) & ~__GFP_FS); k_page->flags = K_PG_locked; page_addr = (char *) kmap(k_page->page); pos = (loff_t)pageid * PAGE_SIZE; + DEBUG(DBG_TRACE, "Can't find page for file/directory = %ld and " \ + "page id = %ld, So created and locked (kmap page address %p, page address %p)\n", iolinker_data->ino, + pageid,page_addr, k_page->page); + /* The page should be filled only if it was not handled * by another node before (i.e if the page is already in * the cache, it means that the page has been inserted @@ -939,11 +941,13 @@ int content_instantiate(kddm_set_t *kddm_set, void *private_data, int master) /* Retrieve local path corresponding to kfds inode number*/ kdfs_getphysicalpath(k_sb, content_data->ino, content_data->phys_dirname); - if (check_create_phys_dir(content_data->phys_dirname, 0777, 0, 0) != 0) - BUG(); + result = check_create_phys_dir(content_data->phys_dirname, 0777, 0, 0); + if (result != 0) + DEBUG(DBG_PANIC, "Something wrong during check_create_phys_dir (error=%d)", result); /* Try to open the physical associated file */ phys_dirname = content_data->phys_dirname + strlen(content_data->phys_dirname); + // For versionning purpose: TODO add specific defines snprintf(content_data->phys_dirname, PATH_MAX, "%s/.meta.index", content_data->phys_dirname); filp = open_phys_file(content_data->phys_dirname, O_RDONLY, 0644, 0, 0); *phys_dirname = '\0'; @@ -975,15 +979,14 @@ int content_instantiate(kddm_set_t *kddm_set, void *private_data, int master) /* TODO PRIORITY 2, Adrien, we could have some issue if the kernel tries to remove the inode during this code */ /* Retrieve the local ref to the k_mapping object */ - inode = ilookup(k_sb->sb, content_data->ino); if (inode) { DEBUG(DBG_INFO, "K_mapping from the cache\n"); content_data->k_mapping = inode->i_mapping; iput(inode); } else if (inode_linked_node(content_data->ino) == kerrighed_node_id){ - DEBUG(DBG_INFO, "K_mapping will be retrieve from iget\n"); - inode = kdfs_getinode(k_sb->sb, content_data->ino); + DEBUG(DBG_PANIC, "K_mapping will be retrieve from iget, however this should not occur\n"); +// inode = kdfs_getinode(k_sb->sb, content_data->ino); content_data->k_mapping = inode->i_mapping; } else { /* do dummy stuff */ diff --git a/fs/kdfs/debug_kdfs.h b/fs/kdfs/debug_kdfs.h index d3859ca..abe9ac0 100644 --- a/fs/kdfs/debug_kdfs.h +++ b/fs/kdfs/debug_kdfs.h @@ -1,13 +1,14 @@ /* * KDDM File System file - debug macros * - * @file debug_kdfs.h + * @file debug_kdfs.h * - * @author Adrien Lebre + * @author Adrien Lebre * - * @maintainer Adrien Lebre + * @maintainer Adrien Lebre * - * Copyright (C) 2006-2007, XtreemOS Consortium. + * Copyright (C) 2006-2007, XtreemOS Consortium. + * Copyright (C) 2008-20xx, Mines Nantes - INRIA Rennes Bretagne Atlantique - LINA . */ #ifndef __KDFS_DEBUG__ @@ -28,8 +29,11 @@ #define DBG_WARNING 2 #define DBG_TRACE 3 #define DBG_INFO 4 +#define DBG_DBG 5 -#define KDFS_DEBUG_LEVEL 2 +#define KDFS_DEBUG_LEVEL 4 + +#define KDFS_GENERALINFO "%s & %d | " #ifdef DEBUG #undef DEBUG @@ -38,12 +42,10 @@ #ifdef NDEBUG # define DEBUG(level, format, args...) do {} while(0) #else -# define DEBUG(level, format, args...) \ +# define DEBUG(level, format, ...) \ do { \ if (KDFS_DEBUG_LEVEL >= level) { \ - /*pr_debug*/printk("KDFS - %s @ (%s : %d) - %d | ", __func__, __FILE__, __LINE__, \ - current->pid) ; \ - /*pr_debug*/printk(format, ## args) ; \ + pr_debug("%s @ %d | " format, __func__, __LINE__, ##__VA_ARGS__) ; \ } \ if(level == DBG_PANIC)\ BUG();\ diff --git a/fs/kdfs/file.c b/fs/kdfs/file.c index 70de1ec..367c23c 100644 --- a/fs/kdfs/file.c +++ b/fs/kdfs/file.c @@ -61,7 +61,7 @@ ssize_t kdfs_read(struct file *filp, char *buf, size_t count, loff_t *ppos) struct kdfs_inode *kdfs_inode = NULL; DEBUG(DBG_INFO, - "read %zd bytes from file %s at offset %lld in buffer %p\n", + "Start to read %zd bytes from file %s at offset %lld in buffer %p\n", count, filp->f_dentry->d_name.name, *ppos, buf); kdfs_inode = kdfs_iget(filp->f_dentry->d_inode->i_ino); @@ -263,7 +263,7 @@ kerrighed_node_t kdfs_iol_file_default_owner (kddm_set_t *kddm_set, // check who's the default owner of the object !!! ret_val = page_linked_node(objid); - DEBUG(DBG_INFO, "######### /\\/\\/\\/ page owner ::: %d\n", ret_val); + DEBUG(DBG_DBG, "######### /\\/\\/\\/ page owner ::: %d\n", ret_val); return ret_val; } diff --git a/fs/kdfs/inode.c b/fs/kdfs/inode.c index 2e238a3..d6536d5 100644 --- a/fs/kdfs/inode.c +++ b/fs/kdfs/inode.c @@ -8,7 +8,8 @@ * * @maintainer Adrien Lebre * - * Copyright (C) 2006-2007, XtreemOS Consortium. + * Copyright (C) 2006-2007, XtreemOS Consortium. + * Copyright (C) 2008-20xx, Mines Nantes - INRIA Rennes Bretagne Atlantique - LINA . */ #include <net/krgrpc/rpc.h> @@ -65,7 +66,7 @@ void print_dentry_cont(struct dentry *entry, int print_inode_info) /*****************************************************************************/ /* */ -/* INODE INTERNAL FUNCTIONS */ +/* INODE INTERNAL FUNCTIONS */ /* */ /*****************************************************************************/ @@ -785,15 +786,16 @@ int kdfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) { - // TODO Which funtions set up the right inode; - // TODO Why this function is called twice when i make a ls struct inode *inode = dentry->d_inode; struct kdfs_inode *k_inode; struct kdfs_cw_sb *k_cwsb; int r = 0; DEBUG (DBG_TRACE, "getattr for file %s (inodeid=%ld)\n", dentry->d_name.name,inode->i_ino); - k_cwsb = __kdfs_grab_cwsb(); + + // Check whether the node storing the .meta file is reachable or not + // TODO: Adrien, performance impact ? + k_cwsb = __kdfs_get_cwsb(); if (!test_bit(inode_linked_node(inode->i_ino), (unsigned long *) k_cwsb->cw_bitmap->map)) { r = -ENODEV; __kdfs_put_cwsb(); @@ -801,6 +803,7 @@ int kdfs_getattr(struct vfsmount *mnt, } __kdfs_put_cwsb(); + // Get the atttr for the inode k_inode = kdfs_iget(inode->i_ino); //k_inode->inode->i_blocks = k_inode->inode->i_size / (k_inode->inode->i_blkbits/8); //TODO Find a way to determine n for 2^n = (k_inode->inode->i_blkbits/8) @@ -1129,13 +1132,16 @@ int kdfs_iol_inode_first_touch(kddm_obj_t *objEntry, "First touch inode (%ld;%ld)\n", kddm_set->id, objid); - if (objEntry->object == NULL) { k_inode = kmalloc(sizeof(struct kdfs_inode), GFP_KERNEL); ASSERT(k_inode != NULL); atomic_set(&k_inode->cw_count, 0); /* initialise the extents */ kdfs_file_extent_init(k_inode); - + + /* + * Initialize and fill the k_inode + */ + // Case 1: it's a new file, so a new inode if (flags & KDDM_CREATE_ON_FT) { k_inode->inode = new_inode (k_sb->sb); k_inode->flags = K_INODE_CREATING|K_INODE_INITIALIZING; @@ -1143,37 +1149,28 @@ int kdfs_iol_inode_first_touch(kddm_obj_t *objEntry, DEBUG(DBG_PANIC, "Cannot find inode %ld\n", objid); k_inode->inode->i_ino = objid; insert_inode_hash(k_inode->inode); - } else { - /* - * Check if the inode is locally in the cache - * Can happen when a content associated kddm set has been instantiated - */ - k_inode->inode = ilookup(k_sb->sb, objid); - if (k_inode->inode) { - iput(k_inode->inode); - } else { - k_inode->inode = kdfs_getinode(k_sb->sb, objid); - kdfs_file_extent_read_from_file(k_inode); - } - k_inode->flags = K_INODE_OK; + } + // Case 2: the inode already exists, so fill it from the HDD + else if (kdfs_fill_kinode(k_sb->sb, objid, k_inode) < 0) { + DEBUG(DBG_PANIC, "Cannot retrieve the physical informations to fill the k_inode"); } + k_inode->flags = K_INODE_OK; k_inode->content_setid = KDDM_SET_UNUSED; objEntry->object = (void *) k_inode; DEBUG(DBG_INFO, "inode count %d\n", atomic_read(&k_inode->inode->i_count)); - } - if (inode_linked_node(objid) == kerrighed_node_id) { - char *phys_dirname; - /* Find the physical path corresponding to the KDFS inode */ - phys_dirname = kmalloc(PATH_MAX, GFP_KERNEL); - ASSERT(phys_dirname != NULL); - - kdfs_getphysicalpath(k_sb, objid, phys_dirname); - if (check_create_phys_dir(phys_dirname, 0777, 0, 0) != 0) - BUG(); - kfree(phys_dirname); - } +// if (inode_linked_node(objid) == kerrighed_node_id) { +// char *phys_dirname; +// /* Find the physical path corresponding to the KDFS inode */ +// phys_dirname = kmalloc(PATH_MAX, GFP_KERNEL); +// ASSERT(phys_dirname != NULL); +// +// kdfs_getphysicalpath(k_sb, objid, phys_dirname); +// if (check_create_phys_dir(phys_dirname, 0777, 0, 0) != 0) +// BUG(); +// kfree(phys_dirname); +// __kdfs_twice_putsb(k_sb); PRINT_FUNCTION_EXIT; diff --git a/fs/kdfs/physical_fs.c b/fs/kdfs/physical_fs.c index 2c9637b..8bd60c1 100644 --- a/fs/kdfs/physical_fs.c +++ b/fs/kdfs/physical_fs.c @@ -102,6 +102,8 @@ long create_phys_dir(const char *pathname, path_put(&nd.path); out: + if (error != 0) + DEBUG(DBG_ALERT, "function EXIT: Physical operation does not succeed (error %d)\n",error); __revert_old_creds(overridden_creds, old_creds); return error; diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index b2fc70e..d91e522 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -262,6 +262,12 @@ ino_t kdfs_get_freeino(struct kdfs_super_block *k_sb) DEBUG(DBG_INFO, "Next free inode #: %lu\n", sb_bitmap_get_available(k_sb)); + /* Force bitmap synchronization for each inode creation + * PERFORMANCE IMPACT ! + * TODO Priority 3: Adrien, Find the right place to synchronize the bitmap on HDD + */ + sb_bitmap_save(k_sb); + ino = full_inode_number(ino, k_sb->sb_nodeid); out: PRINT_FUNCTION_EXIT; @@ -393,7 +399,7 @@ void kdfs_getphysicalpath(struct kdfs_super_block *k_sb, unsigned long ino, tmp_nodeid = inode_linked_node(ino); sprintf(phys_filename, "%s%d/%ld-%ld/%ld", k_sb->k_opt->part_name, tmp_nodeid, (unsigned long)(tmp_ino / 100) * 100, (unsigned long)(tmp_ino / 100) * 100 + 99, tmp_ino); - DEBUG(DBG_INFO, "Physical file for inode %ld: %s\n", ino, phys_filename); + DEBUG(DBG_INFO, "function EXIT: Physical file for inode %ld: %s\n", ino, phys_filename); } /* @@ -917,20 +923,23 @@ int kdfs_statfs(struct dentry *dfs, struct kstatfs *buf) /* * Read a physical inode of kDFS - * This function is called by the VFS when a kDFS inode has to be physically + * This function is called when a kDFS inode has to be physically * read. * * @author Adrien Lebre - * @param inode the VFS inode + * @param k_inode the k_inode to fill * */ -struct inode *kdfs_getinode(struct super_block *sb, unsigned long ino) +int kdfs_fill_kinode(struct super_block *sb, unsigned long ino, struct kdfs_inode *k_inode) { struct inode *inode = NULL; struct file *file = NULL; char *phys_filename = NULL; struct kdfs_physical_inode phys_inode; - + size_t no_extents = 0, index; + struct kdfs_file_extent_info record; + struct kdfs_file_extent *new_extent, *curr; + PRINT_FUNCTION_NAME ; /* @@ -940,11 +949,19 @@ struct inode *kdfs_getinode(struct super_block *sb, unsigned long ino) * reach it. It is probably not the best and cleanest solution. */ inode = iget_locked(sb, ino); - if (!inode) - return ERR_PTR(-ENOMEM); - if (!(inode->i_state & I_NEW)) - return inode; - + if (!inode){ + DEBUG(DBG_ALERT, "End of Memory, cannot allocate a new inode"); + return -ENOMEM; + } + /* + * Check if the inode is locally in the cache + * Should not occur (theoretically :/) + */ + if (!(inode->i_state & I_NEW)){ + DEBUG(DBG_ALERT, "Inode already in the cache, strange...."); + k_inode->inode=inode; + } + /* Retrieve the inode meta file */ phys_filename = kmalloc(PATH_MAX, GFP_KERNEL); ASSERT(phys_filename != NULL); @@ -974,18 +991,44 @@ struct inode *kdfs_getinode(struct super_block *sb, unsigned long ino) * kdfs_iol_inode_insert() due to the clusterwide constraints * (cf. inode.c) */ + + k_inode-> inode = inode ; + + /* + * Read the extent part + * copy/paste from kdfs_file_extent_read_from_file(struct kdfs_inode *k_inode) + * cf. file_extent.c + */ + /* read the number of elements */ + kdfs_phys_read(file, (char *)&(no_extents), sizeof(size_t), &file->f_pos); + /* now, read the extents list */ + for(index = 0; index < no_extents; index++) { + kdfs_phys_read(file, (char *)&(record), sizeof(struct kdfs_file_extent_info), &file->f_pos); + new_extent = kmalloc(sizeof(struct kdfs_file_extent), GFP_KERNEL); + new_extent->data.page_first = record.page_first; + new_extent->data.page_last = record.page_last; + new_extent->data.extent_owner = record.extent_owner; + list_add_tail(&new_extent->list_item, &k_inode->extents_list); + } + DEBUG(DBG_INFO, "\t inode extents\n"); + if (!list_empty(&k_inode->extents_list)) { + list_for_each_entry(curr, &k_inode->extents_list, list_item) { + DEBUG(DBG_INFO, "\t\t f=%lu, l=%lu, o=%d\n", curr->data.page_first, curr->data.page_last, curr->data.extent_owner); + } + } close_phys_file(file); - } else + } + else DEBUG(DBG_ALERT, - "Can't access to the KDFS inode %ld\n" - "Please verify type of the partition %s, it should be a KDFS one", - inode->i_ino, ((struct kdfs_super_block*)inode->i_sb->s_fs_info)->k_opt->part_name); + "Can't access to the KDFS inode %ld\n" + "Please verify type of the partition %s, it should be a KDFS one", + inode->i_ino, ((struct kdfs_super_block*)inode->i_sb->s_fs_info)->k_opt->part_name); kfree(phys_filename); unlock_new_inode(inode); PRINT_FUNCTION_EXIT; - return inode; + return 0; } /* @@ -1070,7 +1113,7 @@ int __kdfs_write_inode(struct kdfs_inode *k_inode) void kdfs_drop_inode(struct inode *inode) { struct kdfs_inode *k_inode = NULL; - DEBUG(DBG_INFO, "inode id %ld ", inode->i_ino); + DEBUG(DBG_INFO, "inode id %ld\n", inode->i_ino); if (inode->i_nlink) { /* Generic forget is unfortunately not exported */ @@ -1082,7 +1125,8 @@ void kdfs_drop_inode(struct inode *inode) k_inode = kdfs_igrab(inode->i_ino); /* Associated kddm desallocation */ - __local_destroy_content_kddm_set(k_inode); + // ICI + //__local_destroy_content_kddm_set(k_inode); kdfs_idrop(inode->i_ino); } else diff --git a/fs/kdfs/super.h b/fs/kdfs/super.h index fb32ada..58d2166 100644 --- a/fs/kdfs/super.h +++ b/fs/kdfs/super.h @@ -194,7 +194,7 @@ void cleanup_kdfs(void); void kdfs_getphysicalpath(struct kdfs_super_block *k_sb, unsigned long ino, char *physical_filename); int __kdfs_write_inode(struct kdfs_inode *k_inode); -struct inode *kdfs_getinode(struct super_block *sb, unsigned long ino); +int kdfs_fill_kinode(struct super_block *sb, unsigned long ino, struct kdfs_inode *k_inode); /* Get a free inode id from kdfs_sb partition */ ino_t kdfs_get_freeino(struct kdfs_super_block *k_sb); diff --git a/fs/kdfs/wip/junk-code b/fs/kdfs/wip/junk-code new file mode 100644 index 0000000..0da29e7 --- /dev/null +++ b/fs/kdfs/wip/junk-code @@ -0,0 +1,14 @@ +#ifdef NDEBUG +# define DEBUG(type, level, format, args...) do {} while(0) +#else +# define DEBUG(type, level, format, args...) \ +do { \ + if (match_debug("kDFS", type, level)) { \ + printk ("%s - (%s) - %d : ", KDFS_PART, __PRETTY_FUNCTION__, \ + current->pid) ; \ + printk (format, ## args) ; \ + } \ + if(level == DBG_PANIC)\ + BUG();\ +} while (0) +#endif commit ba273f9d120a368e9695820f4a5ec870733c81e4 Merge: 09fd7d0 3bbbed7 Author: root <root@krgserver.dirty.world> Date: Tue Jul 6 15:01:14 2010 +0000 Merge branch 'master' of git://mirrors.git.kernel.org/cluster/kerrighed/kernel into make_kdfs_compile commit 3bbbed7a4f4e8a8b1004f461a5f0ba04ab12be9e Author: Matthieu Fertré <mat...@ke...> Date: Fri Jun 25 16:44:39 2010 +0200 [BUGFIX] Fix function get_file_size() Using directly i_size_read() to get the size is unsafe on some file systems. diff --git a/fs/stat.c b/fs/stat.c index daa2e31..2311a02 100644 --- a/fs/stat.c +++ b/fs/stat.c @@ -58,20 +58,33 @@ int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) EXPORT_SYMBOL(vfs_getattr); +#ifdef CONFIG_KRG_DVFS +int do_fstat(struct file *f, struct kstat *stat) +{ + int error; + +#ifdef CONFIG_KRG_FAF + if (f->f_flags & O_FAF_CLT) + error = krg_faf_fstat(f, stat); + else +#endif + error = vfs_getattr(f->f_path.mnt, f->f_path.dentry, stat); + + return error; +} +#endif + int vfs_fstat(unsigned int fd, struct kstat *stat) { struct file *f = fget(fd); int error = -EBADF; if (f) { -#ifdef CONFIG_KRG_FAF - if (f->f_flags & O_FAF_CLT) { - error = krg_faf_fstat(f, stat); - fput(f); - return error; - } -#endif +#ifdef CONFIG_KRG_DVFS + error = do_fstat(f, stat); +#else error = vfs_getattr(f->f_path.mnt, f->f_path.dentry, stat); +#endif fput(f); } return error; diff --git a/include/linux/fs.h b/include/linux/fs.h index c1d3ac1..070c311 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2318,6 +2318,9 @@ void inode_set_bytes(struct inode *inode, loff_t bytes); extern int vfs_readdir(struct file *, filldir_t, void *); +#ifdef CONFIG_KRG_DVFS +extern int do_fstat(struct file *file, struct kstat *stat); +#endif extern int vfs_stat(char __user *, struct kstat *); extern int vfs_lstat(char __user *, struct kstat *); extern int vfs_fstat(unsigned int, struct kstat *); diff --git a/kerrighed/fs/mobility.c b/kerrighed/fs/mobility.c index 6e8c626..a639937 100644 --- a/kerrighed/fs/mobility.c +++ b/kerrighed/fs/mobility.c @@ -179,21 +179,14 @@ err: static int get_file_size(struct file *file, loff_t *size) { int r = 0; + struct kstat stat; -#ifdef CONFIG_KRG_FAF - if (file->f_flags & O_FAF_CLT) { - struct kstat stat; - r = krg_faf_fstat(file, &stat); - if (r) - goto exit; + r = do_fstat(file, &stat); + if (r) + goto exit; - *size = stat.size; - } else -#endif - *size = i_size_read(file->f_dentry->d_inode); -#ifdef CONFIG_KRG_FAF + *size = stat.size; exit: -#endif return r; } commit 090f74bf5431caa5d6a8185de22341ec77eafc5e Author: Matthieu Fertré <mat...@ke...> Date: Thu Jun 24 16:28:21 2010 +0200 [BUGFIX] Reset content of app_struct->restart at the end of restart Else app_struct->checkpoint may contain invalid values since app_struct->checkpoint and app_struct->restart are in the same anonymous union. diff --git a/kerrighed/epm/application/app_restart.c b/kerrighed/epm/application/app_restart.c index 1a84a82..b7ef0ec 100644 --- a/kerrighed/epm/application/app_restart.c +++ b/kerrighed/epm/application/app_restart.c @@ -1169,6 +1169,8 @@ static void handle_do_restart(struct rpc_desc *desc, void *_msg, size_t size) } #endif + memset(&app->restart, 0, sizeof(app->restart)); + err_end_pid: if (app->cred) { app->cred = NULL; commit 8b0bb79523c616e2aa8fd416f79cb73565010619 Author: Matthieu Fertré <mat...@ke...> Date: Wed Jun 23 15:50:54 2010 +0200 [BUGFIX] Fix behavior of get/setpriority() in Linux root container The original behavior has been broken by commit 3ebf1fe76829048c780b50ea97a3e3681be7edcf that implements correct behavior in Kerrighed container. diff --git a/kernel/sys.c b/kernel/sys.c index 843eea2..8367e6a 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -277,11 +277,8 @@ static int krg_setpriority_pg_user(int which, int who, int niceval) kerrighed_node_t node; int retval = -ESRCH, noderet, err; - if (!current->nsproxy->krg_ns) - goto out; - - if (!is_krg_pid_ns_root(task_active_pid_ns(current))) - goto out; + BUG_ON(!current->nsproxy->krg_ns + || !is_krg_pid_ns_root(task_active_pid_ns(current))); if (which == PRIO_PGRP && !(who & GLOBAL_PID_MASK)) @@ -365,19 +362,28 @@ SYSCALL_DEFINE3(setpriority, int, which, int, _who, int, niceval) int retval; int who = _who; + if (which == PRIO_PGRP && !who) + who = pid_nr_ns(task_pgrp(current), + task_active_pid_ns(current)); + + if (!current->nsproxy->krg_ns + || !is_krg_pid_ns_root(task_active_pid_ns(current))) { + /* not in the kerrighed container */ + retval = do_setpriority(which, who, niceval, + task_active_pid_ns(current)); + goto out; + } + switch (which) { case PRIO_PROCESS: + /* make a first try locally */ retval = do_setpriority(which, who, niceval, task_active_pid_ns(current)); if (retval == -ESRCH) retval = krg_setpriority_process(who, niceval); break; case PRIO_PGRP: - if (!who) - who = pid_nr_ns(task_pgrp(current), - task_active_pid_ns(current)); - /* do not break here */ case PRIO_USER: retval = krg_setpriority_pg_user(which, who, niceval); break; @@ -386,6 +392,7 @@ SYSCALL_DEFINE3(setpriority, int, which, int, _who, int, niceval) break; } +out: return retval; } #endif @@ -514,11 +521,8 @@ static int krg_getpriority_pg_user(int which, int who) kerrighed_node_t node; int retval = -ESRCH, noderet, err; - if (!current->nsproxy->krg_ns) - goto out; - - if (!is_krg_pid_ns_root(task_active_pid_ns(current))) - goto out; + BUG_ON(!current->nsproxy->krg_ns + || !is_krg_pid_ns_root(task_active_pid_ns(current))); if (which == PRIO_PGRP && !(who & GLOBAL_PID_MASK)) @@ -602,19 +606,29 @@ SYSCALL_DEFINE2(getpriority, int, which, int, _who) int retval; int who = _who; + if (which == PRIO_PGRP && !who) + who = pid_nr_ns(task_pgrp(current), + task_active_pid_ns(current)); + + if (!current->nsproxy->krg_ns + || !is_krg_pid_ns_root(task_active_pid_ns(current))) { + /* not in the kerrighed container */ + retval = do_getpriority(which, who, + task_active_pid_ns(current)); + goto out; + } + switch (which) { case PRIO_PROCESS: + /* make a first try locally */ retval = do_getpriority(which, who, task_active_pid_ns(current)); + if (retval == -ESRCH) retval = krg_getpriority_process(who); break; case PRIO_PGRP: - if (!who) - who = pid_nr_ns(task_pgrp(current), - task_active_pid_ns(current)); - /* do not break here */ case PRIO_USER: retval = krg_getpriority_pg_user(which, who); break; @@ -623,6 +637,7 @@ SYSCALL_DEFINE2(getpriority, int, which, int, _who) break; } +out: return retval; } #endif commit 3b8fb32c231e5f80316411e2bb13f5360f49b6c6 Author: Matthieu Fertré <mat...@ke...> Date: Tue Jun 22 14:32:04 2010 +0200 krgfaf: fix read/write stats with sendfile() diff --git a/fs/read_write.c b/fs/read_write.c index 39751cd..ffa10f4 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -859,6 +859,9 @@ ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, loff_t pos; ssize_t retval; int fput_needed_in, fput_needed_out, fl; +#ifdef CONFIG_KRG_FAF + u64 rchar, wchar, syscr, syscw; +#endif /* * Get input file, and verify that it is ok.. @@ -926,10 +929,21 @@ faf_sendfile: if (in_file->f_flags & O_FAF_CLT || out_file->f_flags & O_FAF_CLT) { + rchar = get_rchar(current); + wchar = get_wchar(current); + syscr = get_syscr(current); + syscw = get_syscw(current); + if (!max) max = *ppos + count; retval = krg_faf_sendfile(out_file, in_file, ppos, count, max); + + set_rchar(current, rchar); + set_wchar(current, wchar); + set_syscr(current, syscr); + set_syscw(current, syscw); + goto update_stat; } #endif diff --git a/include/linux/sched.h b/include/linux/sched.h index 4c6669b..a76055f 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -2459,6 +2459,50 @@ static inline void inc_syscw(struct task_struct *tsk) { tsk->ioac.syscw++; } + +#ifdef CONFIG_KRG_FAF +static inline u64 get_rchar(struct task_struct *tsk) +{ + return tsk->ioac.rchar; +} + +static inline void set_rchar(struct task_struct *tsk, u64 rchar) +{ + tsk->ioac.rchar = rchar; +} + +static inline u64 get_wchar(struct task_struct *tsk) +{ + return tsk->ioac.wchar; +} + +static inline void set_wchar(struct task_struct *tsk, u64 wchar) +{ + tsk->ioac.wchar = wchar; +} + +static inline u64 get_syscr(struct task_struct *tsk) +{ + return tsk->ioac.syscr; +} + +static inline void set_syscr(struct task_struct *tsk, u64 syscr) +{ + tsk->ioac.syscr = syscr; +} + +static inline u64 get_syscw(struct task_struct *tsk) +{ + return tsk->ioac.syscw; +} + +static inline void set_syscw(struct task_struct *tsk, u64 syscw) +{ + tsk->ioac.syscw = syscw; +} + +#endif + #else static inline void add_rchar(struct task_struct *tsk, ssize_t amt) { @@ -2475,6 +2519,45 @@ static inline void inc_syscr(struct task_struct *tsk) static inline void inc_syscw(struct task_struct *tsk) { } + +#ifdef CONFIG_KRG_FAF +static inline u64 get_rchar(struct task_struct *tsk) +{ + return 0; +} + +static inline void set_rchar(struct task_struct *tsk, u64 rchar) +{ +} + +static inline u64 get_wchar(struct task_struct *tsk) +{ + return 0; +} + +static inline void set_rchar(struct task_struct *tsk, u64 rchar) +{ +} + +static inline u64 get_syscr(struct task_struct *tsk) +{ + return 0; +} + +static inline void set_syscr(struct task_struct *tsk, u64 syscr) +{ +} + +static inline u64 get_syscw(struct task_struct *tsk) +{ + return 0; +} + +static inline void set_syscw(struct task_struct *tsk, u64 syscw) +{ +} +#endif + #endif #ifndef TASK_SIZE_OF commit 5c596a74126b55d39d13d692df8a24ce1c3dd036 Author: Matthieu Fertré <mat...@ke...> Date: Tue Jun 22 13:49:18 2010 +0200 krgfaf: optimize sendfile if both fds are hosted on the same faf server diff --git a/fs/read_write.c b/fs/read_write.c index 72e4775..39751cd 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -848,7 +848,10 @@ SYSCALL_DEFINE5(pwritev, unsigned long, fd, const struct iovec __user *, vec, return ret; } -static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, +#ifndef CONFIG_KRG_FAF +static +#endif +ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, size_t count, loff_t max) { struct file * in_file, * out_file; diff --git a/include/net/krgrpc/rpcid.h b/include/net/krgrpc/rpcid.h index 22dab52..834e657 100644 --- a/include/net/krgrpc/rpcid.h +++ b/include/net/krgrpc/rpcid.h @@ -39,6 +39,7 @@ enum rpcid { RPC_FAF_GETSOCKOPT, RPC_FAF_SENDMSG, RPC_FAF_RECVMSG, + RPC_FAF_SENDFILE, RPC_FAF_NOTIFY_CLOSE, /* Ctnr Object Server Types */ diff --git a/kerrighed/fs/faf/faf_hooks.c b/kerrighed/fs/faf/faf_hooks.c index f6af126..b622ff9 100644 --- a/kerrighed/fs/faf/faf_hooks.c +++ b/kerrighed/fs/faf/faf_hooks.c @@ -1514,6 +1514,49 @@ cancel: goto out_end; } +static ssize_t fwd_sendfile(faf_client_data_t *out, faf_client_data_t *in, + loff_t *ppos, size_t count, loff_t max) +{ + struct rpc_desc *desc; + struct faf_sendfile_msg msg; + ssize_t retval; + int err; + + desc = rpc_begin(RPC_FAF_SENDFILE, in->server_id); + if (!desc) { + retval = -ENOMEM; + goto out; + } + + msg.out_fd = out->server_fd; + msg.in_fd = in->server_fd; + msg.ppos = *ppos; + msg.count = count; + msg.max = max; + + err = rpc_pack_type(desc, msg); + if (err) + goto cancel; + + err = rpc_unpack_type(desc, *ppos); + if (err) + goto cancel; + + err = rpc_unpack_type(desc, retval); + if (err) + goto cancel; + +out_end: + rpc_end(desc, 0); +out: + return retval; + +cancel: + rpc_cancel(desc); + retval = err; + goto out_end; +} + ssize_t krg_faf_sendfile(struct file *out, struct file *in, loff_t *ppos, size_t count, loff_t max) { @@ -1536,10 +1579,9 @@ ssize_t krg_faf_sendfile(struct file *out, struct file *in, loff_t *ppos, BUG_ON(!out_data && !in_data); - /* TODO: simply forward the call */ -/* if (in_data && out_data */ -/* && in_data->server_id && out_data->server_id) */ -/* return 0; */ + if (in_data && out_data + && in_data->server_id == out_data->server_id) + return fwd_sendfile(out_data, in_data, ppos, count, max); len = count; if (count > PAGE_SIZE) diff --git a/kerrighed/fs/faf/faf_server.c b/kerrighed/fs/faf/faf_server.c index 9bd8720..16f3898 100644 --- a/kerrighed/fs/faf/faf_server.c +++ b/kerrighed/fs/faf/faf_server.c @@ -1574,6 +1574,29 @@ cancel: goto out_free; } +static void handle_faf_sendfile(struct rpc_desc *desc, void *_msg, size_t size) +{ + struct faf_sendfile_msg *msg = _msg; + ssize_t retval; + int err; + + retval = do_sendfile(msg->out_fd, msg->in_fd, &msg->ppos, msg->count, + msg->max); + + err = rpc_pack_type(desc, msg->ppos); + if (err) + goto cancel; + + err = rpc_pack_type(desc, retval); + if (err) + goto cancel; + + return; + +cancel: + rpc_cancel(desc); +} + int handle_faf_notify_close (struct rpc_desc* desc, void *msgIn, size_t size) { @@ -1630,6 +1653,7 @@ void faf_server_init (void) rpc_register_void(RPC_FAF_GETSOCKOPT, handle_faf_getsockopt, 0); rpc_register_void(RPC_FAF_SENDMSG, handle_faf_sendmsg, 0); rpc_register_void(RPC_FAF_RECVMSG, handle_faf_recvmsg, 0); + rpc_register_void(RPC_FAF_SENDFILE, handle_faf_sendfile, 0); rpc_register_int(RPC_FAF_NOTIFY_CLOSE, handle_faf_notify_close, 0); } diff --git a/kerrighed/fs/faf/faf_server.h b/kerrighed/fs/faf/faf_server.h index e4ad454..66a28a2 100644 --- a/kerrighed/fs/faf/faf_server.h +++ b/kerrighed/fs/faf/faf_server.h @@ -118,6 +118,14 @@ struct faf_sendmsg_msg { size_t total_len; }; +struct faf_sendfile_msg { + int out_fd; + int in_fd; + loff_t ppos; + size_t count; + loff_t max; +}; + struct faf_poll_wait_msg { int server_fd; unsigned long objid; @@ -136,6 +144,8 @@ struct linux_dirent64; extern int do_getdents64(struct file *file, struct linux_dirent64 *dirent, unsigned int count); +extern ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, + size_t count, loff_t max); /*--------------------------------------------------------------------------* * * commit e15f87760a1dccc6c616ade8bb2f421869e4482d Author: Matthieu Fertré <mat...@ke...> Date: Tue Jun 22 13:24:20 2010 +0200 krgfaf: implements support of sendfile() diff --git a/fs/read_write.c b/fs/read_write.c index 336bc8f..72e4775 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -253,6 +253,11 @@ int rw_verify_area(int read_write, struct file *file, loff_t *ppos, size_t count loff_t pos; int retval = -EINVAL; +#ifdef CONFIG_KRG_FAF + if (file->f_flags & O_FAF_CLT) + inode = NULL; + else +#endif inode = file->f_path.dentry->d_inode; if (unlikely((ssize_t) count < 0)) return retval; @@ -260,6 +265,9 @@ int rw_verify_area(int read_write, struct file *file, loff_t *ppos, size_t count if (unlikely((pos < 0) || (loff_t) (pos + count) < 0)) return retval; +#ifdef CONFIG_KRG_FAF + if (inode) +#endif if (unlikely(inode->i_flock && mandatory_lock(inode))) { retval = locks_mandatory_area( read_write == READ ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE, @@ -858,6 +866,12 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, goto out; if (!(in_file->f_mode & FMODE_READ)) goto fput_in; +#ifdef CONFIG_KRG_FAF + if (in_file->f_flags & O_FAF_CLT) { + in_inode = NULL; /* to please gcc */ + goto check_outfile; + } +#endif retval = -EINVAL; in_inode = in_file->f_path.dentry->d_inode; if (!in_inode) @@ -870,6 +884,9 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, else if (!(in_file->f_mode & FMODE_PREAD)) goto fput_in; +#ifdef CONFIG_KRG_FAF +check_outfile: +#endif retval = rw_verify_area(READ, in_file, ppos, count); if (retval < 0) goto fput_in; @@ -884,15 +901,35 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, goto fput_in; if (!(out_file->f_mode & FMODE_WRITE)) goto fput_out; +#ifdef CONFIG_KRG_FAF + if (out_file->f_flags & O_FAF_CLT) { + out_inode = NULL; /* to please gcc */ + goto faf_sendfile; + } +#endif retval = -EINVAL; if (!out_file->f_op || !out_file->f_op->sendpage) goto fput_out; out_inode = out_file->f_path.dentry->d_inode; +#ifdef CONFIG_KRG_FAF +faf_sendfile: +#endif retval = rw_verify_area(WRITE, out_file, &out_file->f_pos, count); if (retval < 0) goto fput_out; count = retval; +#ifdef CONFIG_KRG_FAF + if (in_file->f_flags & O_FAF_CLT + || out_file->f_flags & O_FAF_CLT) { + + if (!max) + max = *ppos + count; + + retval = krg_faf_sendfile(out_file, in_file, ppos, count, max); + goto update_stat; + } +#endif if (!max) max = min(in_inode->i_sb->s_maxbytes, out_inode->i_sb->s_maxbytes); @@ -920,6 +957,9 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, #endif retval = do_splice_direct(in_file, ppos, out_file, count, fl); +#ifdef CONFIG_KRG_FAF +update_stat: +#endif if (retval > 0) { add_rchar(current, retval); add_wchar(current, retval); diff --git a/include/kerrighed/faf.h b/include/kerrighed/faf.h index c239892..39690ad 100644 --- a/include/kerrighed/faf.h +++ b/include/kerrighed/faf.h @@ -92,6 +92,8 @@ ssize_t krg_faf_sendmsg(struct file *file, struct msghdr *msg, size_t total_len); ssize_t krg_faf_recvmsg(struct file *file, struct msghdr *msg, size_t total_len, unsigned int flags); +ssize_t krg_faf_sendfile(struct file *out, struct file *in, loff_t *ppos, + size_t count, loff_t max); int krg_faf_poll_wait(struct file *file, int wait); void krg_faf_poll_dequeue(struct file *file); diff --git a/kerrighed/fs/faf/faf_hooks.c b/kerrighed/fs/faf/faf_hooks.c index c8961d6..f6af126 100644 --- a/kerrighed/fs/faf/faf_hooks.c +++ b/kerrighed/fs/faf/faf_hooks.c @@ -28,6 +28,7 @@ #include <kerrighed/hotplug.h> #include <net/krgrpc/rpc.h> #include <net/krgrpc/rpcid.h> +#include <kerrighed/dvfs.h> #include <kerrighed/file.h> #include "../file_struct_io_linker.h" @@ -1513,6 +1514,76 @@ cancel: goto out_end; } +ssize_t krg_faf_sendfile(struct file *out, struct file *in, loff_t *ppos, + size_t count, loff_t max) +{ + faf_client_data_t *out_data, *in_data; + char *buf; + mm_segment_t oldfs; + loff_t outpos; + size_t len; + ssize_t size, total_size, retval; + + if (out->f_flags & O_FAF_CLT) + out_data = out->private_data; + else + out_data = NULL; + + if (in->f_flags & O_FAF_CLT) + in_data = in->private_data; + else + in_data = NULL; + + BUG_ON(!out_data && !in_data); + + /* TODO: simply forward the call */ +/* if (in_data && out_data */ +/* && in_data->server_id && out_data->server_id) */ +/* return 0; */ + + len = count; + if (count > PAGE_SIZE) + len = PAGE_SIZE; + + oldfs = get_fs(); + set_fs(KERNEL_DS); + + buf = kmalloc(len, GFP_KERNEL); + if (!buf) { + retval = -ENOMEM; + goto out; + } + + total_size = 0; + + while (count != 0) { + size = vfs_read(in, buf, len, ppos); + if (size < 0) { + retval = size; + goto reset_fs; + } + + outpos = file_pos_read(out); + retval = vfs_write(out, buf, size, &outpos); + if (retval < 0) + goto reset_fs; + + total_size += size; + count -= size; + len = count; + if (count > PAGE_SIZE) + len = PAGE_SIZE; + } + + retval = total_size; + +reset_fs: + set_fs(oldfs); + kfree(buf); +out: + return retval; +} + void krg_faf_srv_close(struct file *file) { check_close_faf_srv_file(file); commit 9383856e21bc97dbfb77238eb74191ab0547ece0 Author: Matthieu Fertré <mat...@ke...> Date: Tue Jun 22 15:03:14 2010 +0200 krgfaf: getdents: allow to be interrupted and fix creds used diff --git a/kerrighed/fs/faf/faf_hooks.c b/kerrighed/fs/faf/faf_hooks.c index ab0f4ad..c8961d6 100644 --- a/kerrighed/fs/faf/faf_hooks.c +++ b/kerrighed/fs/faf/faf_hooks.c @@ -526,7 +526,15 @@ int krg_faf_getdents(struct file *file, enum getdents_filler filler, if (err_rpc) goto cancel; - err_rpc = rpc_unpack_type(desc, err); + err_rpc = pack_creds(desc, current_cred()); + if (err_rpc) + goto cancel; + + err_rpc = unpack_remote_sleep_res_prepare(desc); + if (err_rpc) + goto cancel; + + err_rpc = unpack_remote_sleep_res_type(desc, err); if (err_rpc) goto cancel; diff --git a/kerrighed/fs/faf/faf_server.c b/kerrighed/fs/faf/faf_server.c index 3e68bdf..9bd8720 100644 --- a/kerrighed/fs/faf/faf_server.c +++ b/kerrighed/fs/faf/faf_server.c @@ -440,19 +440,28 @@ cancel: static void handle_faf_getdents(struct rpc_desc *desc, void *__msg, size_t size) { struct faf_getdents_msg *msg = __msg; + const struct cred *old_cred = NULL; struct file *file; - void *dirent; + void *dirent = NULL; int err, err_rpc; - dirent = kmalloc(msg->count, GFP_KERNEL); - if (!dirent) { - err = -ENOMEM; - goto send_error; + old_cred = unpack_override_creds(desc); + if (IS_ERR(old_cred)) { + old_cred = NULL; + goto cancel; } + dirent = kmalloc(msg->count, GFP_KERNEL); + if (!dirent) + goto cancel; + file = fget(msg->server_fd); BUG_ON(!file); + err = remote_sleep_prepare(desc); + if (err) + goto cancel; + switch (msg->filler) { case OLDREADDIR: err = do_oldreaddir(file, dirent, msg->count); @@ -469,20 +478,33 @@ static void handle_faf_getdents(struct rpc_desc *desc, void *__msg, size_t size) break; } + remote_sleep_finish(); fput(file); -send_error: err_rpc = rpc_pack_type(desc, err); - if (err <= 0 || err_rpc) + if (err_rpc) + goto cancel; + + if (err <= 0) goto out; /* err contains the used size of the buffer */ err_rpc = rpc_pack(desc, 0, dirent, err); if (err_rpc) - rpc_cancel(desc); + goto cancel; out: - kfree(dirent); + if (old_cred) + revert_creds(old_cred); + + if (dirent) + kfree(dirent); + + return; + +cancel: + rpc_cancel(desc); + goto out; } /** Handler for doing an IOCTL in a FAF open file. commit 9113791a3242de6969a7f67296c7f8fae3ef26f7 Author: Louis Rilling <lou...@ke...> Date: Wed Jun 23 17:06:32 2010 +0200 Revert "hotplug/add: Accept nodes already online in the nodes_add() syscall" This reverts commit 9da633cb78e774b493b1ec4cc4fb31e9c8ca1a68. It may break userspace expectations, eg when two concurrent # krgadm nodes add --count 1 are launched. Userspace might expect that this adds two nodes, but this patch could make only one node added without notice. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/kerrighed/hotplug/add.c b/kerrighed/hotplug/add.c index c80020f..0d29aa8 100644 --- a/kerrighed/hotplug/add.c +++ b/kerrighed/hotplug/add.c @@ -128,7 +128,9 @@ static int nodes_add(void __user *arg) if (!krgnodes_subset(ctx->node_set.v, krgnode_present_map)) goto out; - krgnodes_andnot(ctx->node_set.v, ctx->node_set.v, krgnode_online_map); + err = -EPERM; + if (krgnodes_intersects(ctx->node_set.v, krgnode_online_map)) + goto out; err = do_nodes_add(ctx); commit 16b4cb4ebff0d9a88d6d7dbb2a3ecee89fa68c48 Author: Louis Rilling <lou...@ke...> Date: Mon Nov 2 17:58:49 2009 +0100 hotplug/remove: Prepare to automatically remove a node whenever it's Kerrighed container's root task exits The code is not executed right now and will be enabled once minimal support for removing nodes will be implemented. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/kerrighed/hotplug/cluster.c b/kerrighed/hotplug/cluster.c index f54d67f..5f9e808 100644 --- a/kerrighed/hotplug/cluster.c +++ b/kerrighed/hotplug/cluster.c @@ -319,9 +319,19 @@ void krg_ns_root_exit(struct krg_namespace *ns) if (ns == cluster_init_helper_ns) krg_container_abort(-EAGAIN); +#ifdef CONFIG_KRG_HOTPLUG_DEL + /* TODO: Make it race-free */ + if (!IS_KERRIGHED_NODE(KRGFLAGS_STOPPING) + && IS_KERRIGHED_NODE(KRGFLAGS_RUNNING)) + if (self_remove(ns)) + printk("kerrighed: " + "Failed to automatically remove the node! " + "Please retry manually.\n"); +#else printk(KERN_WARNING "kerrighed: Root task exiting! Leaking zombies.\n"); set_current_state(TASK_UNINTERRUPTIBLE); schedule(); +#endif } /* ns->root_task must be blocked and alive to get a reliable result */ diff --git a/kerrighed/hotplug/hotplug_internal.h b/kerrighed/hotplug/hotplug_internal.h index 5d66fbd..563ee7e 100644 --- a/kerrighed/hotplug/hotplug_internal.h +++ b/kerrighed/hotplug/hotplug_internal.h @@ -21,6 +21,7 @@ struct hotplug_context; int do_cluster_start(struct hotplug_context *ctx); int __nodes_add(struct hotplug_context *ctx); +int self_remove(struct krg_namespace *ns); int repair_monitor(void); void update_heartbeat(void); diff --git a/kerrighed/hotplug/remove.c b/kerrighed/hotplug/remove.c index f4f6b10..4b18358 100644 --- a/kerrighed/hotplug/remove.c +++ b/kerrighed/hotplug/remove.c @@ -141,6 +141,24 @@ static int do_nodes_remove(struct hotplug_context *ctx) return ret; } +int self_remove(struct krg_namespace *ns) +{ + struct hotplug_context *ctx; + int err; + + ctx = hotplug_ctx_alloc(ns); + if (!ctx) + return -ENOMEM; + ctx->node_set.subclusterid = kerrighed_subsession_id; + ctx->node_set.v = krgnodemask_of_node(kerrighed_node_id); + + err = do_nodes_remove(ctx); + + hotplug_ctx_put(ctx); + + return err; +} + static int nodes_remove(void __user *arg) { struct __hotplug_node_set __node_set; commit 2d39f2f748e1eea9336b7145575b9d125339beac Author: Louis Rilling <lou...@ke...> Date: Mon Nov 2 17:18:25 2009 +0100 hotplug/remove: Call krg_ns_root_exit() only before container init's death If container init is exiting, we want to be notified only when the last thread exits before reacting. Also put in krg_ns_root_exit() whatever actions will be needed, and give it the krg_namespace instead of the not-so-meaningful exiting thread. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/include/kerrighed/namespace.h b/include/kerrighed/namespace.h index 526c56f..ed711f8 100644 --- a/include/kerrighed/namespace.h +++ b/include/kerrighed/namespace.h @@ -35,6 +35,6 @@ static inline void put_krg_ns(struct krg_namespace *ns) bool can_create_krg_ns(unsigned long flags); -void krg_ns_root_exit(struct task_struct *task); +void krg_ns_root_exit(struct krg_namespace *ns); #endif /* __KRG_NAMESPACE_H__ */ diff --git a/kernel/exit.c b/kernel/exit.c index 80473ba..6233ebe 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -1126,13 +1126,11 @@ NORET_TYPE void do_exit(long code) exit_irq_thread(); #ifdef CONFIG_KRG_HOTPLUG - if (tsk->nsproxy->krg_ns && tsk == tsk->nsproxy->krg_ns->root_task) { - krg_ns_root_exit(tsk); - printk(KERN_WARNING - "kerrighed: Root task exiting! Leaking zombies.\n"); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule(); - } + group_dead = atomic_dec_and_test(&tsk->signal->live); + if (tsk->nsproxy->krg_ns + && same_thread_group(tsk, tsk->nsproxy->krg_ns->root_task) + && group_dead) + krg_ns_root_exit(tsk->nsproxy->krg_ns); #endif #ifdef CONFIG_KRG_PROC @@ -1153,7 +1151,9 @@ NORET_TYPE void do_exit(long code) acct_update_integrals(tsk); +#ifndef CONFIG_KRG_HOTPLUG group_dead = atomic_dec_and_test(&tsk->signal->live); +#endif if (group_dead) { hrtimer_cancel(&tsk->signal->real_timer); exit_itimers(tsk->signal); diff --git a/kerrighed/hotplug/cluster.c b/kerrighed/hotplug/cluster.c index 9c93ac0..f54d67f 100644 --- a/kerrighed/hotplug/cluster.c +++ b/kerrighed/hotplug/cluster.c @@ -314,11 +314,14 @@ static void krg_container_abort(int err) complete(&cluster_init_helper_ready); } -void krg_ns_root_exit(struct task_struct *task) +void krg_ns_root_exit(struct krg_namespace *ns) { - if (cluster_init_helper_ns - && task->nsproxy->krg_ns == cluster_init_helper_ns) + if (ns == cluster_init_helper_ns) krg_container_abort(-EAGAIN); + + printk(KERN_WARNING "kerrighed: Root task exiting! Leaking zombies.\n"); + set_current_state(TASK_UNINTERRUPTIBLE); + schedule(); } /* ns->root_task must be blocked and alive to get a reliable result */ commit 0f2e8ee95482b45bb8ac00b83b0bd4c6dc057d9b Author: Louis Rilling <lou...@ke...> Date: Thu Oct 29 17:50:47 2009 +0100 hotplug/remove: Introduce membership_online_hold()/release() In order to prevent some Kerrighed services, like process migration, to inject objects to nodes being removed, or to block trying to call a disabled service of a removing node, this commit introduces membership_online_hold()/release() to temporarily prevent remove operations from removing nodes from the online map, which in turn ensures that nodes being removed are kept active. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/include/kerrighed/hotplug.h b/include/kerrighed/hotplug.h index ab744a4..b814a06 100644 --- a/include/kerrighed/hotplug.h +++ b/include/kerrighed/hotplug.h @@ -84,4 +84,8 @@ extern void (*kh_node_unreachable)(kerrighed_node_t nodeid); void krg_node_arrival(kerrighed_node_t nodeid); void krg_node_departure(kerrighed_node_t nodeid); +void membership_online_hold(void); +int membership_online_try_hold(void); +void membership_online_release(void); + #endif diff --git a/include/linux/cluster_barrier.h b/include/linux/cluster_barrier.h index af13c81..80da290 100644 --- a/include/linux/cluster_barrier.h +++ b/include/linux/cluster_barrier.h @@ -12,6 +12,7 @@ enum static_cluster_barrier_id { CLUSTER_BARRIER_NONE = 0, KDDM_HOTPLUG_BARRIER, SCHED_HOTPLUG_BARRIER, + ONLINE_HOTPLUG_BARRIER, CLUSTER_BARRIER_MAX, }; diff --git a/kerrighed/hotplug/membership.c b/kerrighed/hotplug/membership.c index 01e5408..5fb9e06 100644 --- a/kerrighed/hotplug/membership.c +++ b/kerrighed/hotplug/membership.c @@ -1,9 +1,29 @@ #include <linux/notifier.h> +#include <linux/rwsem.h> +#include <linux/cluster_barrier.h> #include <kerrighed/hotplug.h> #include <kerrighed/krgnodemask.h> #include <kerrighed/sys/types.h> #include <kerrighed/krginit.h> +static DECLARE_RWSEM(online_sem); +static struct cluster_barrier *online_barrier; + +void membership_online_hold(void) +{ + down_read_non_owner(&online_sem); +} + +int membership_online_try_hold(void) +{ + return down_read_trylock_non_owner(&online_sem); +} + +void membership_online_release(void) +{ + up_read_non_owner(&online_sem); +} + static void membership_online_add(krgnodemask_t *vector) { BUG_ON(krgnodes_intersects(*vector, krgnode_online_map)); @@ -12,20 +32,42 @@ static void membership_online_add(krgnodemask_t *vector) kerrighed_nb_nodes += krgnodes_weight(*vector); } -static void membership_online_remove(krgnodemask_t *vector) +static int membership_online_remove(krgnodemask_t *vector) { + krgnodemask_t nodes; + kerrighed_node_t master; + int err; + BUG_ON(!krgnodes_subset(*vector, krgnode_online_map)); + down_write(&online_sem); + + krgnodes_copy(nodes, krgnode_online_map); + master = first_krgnode(nodes); + + err = cluster_barrier(online_barrier, &nodes, master); + if (err) + goto unlock; + krgnodes_andnot(krgnode_online_map, krgnode_online_map, *vector); kerrighed_nb_nodes -= krgnodes_weight(*vector); + + err = cluster_barrier(online_barrier, &nodes, master); + +unlock: + up_write(&online_sem); + + return err; } static void membership_online_clear(krgnodemask_t *vector) { BUG_ON(!krgnode_isset(kerrighed_node_id, *vector)); + down_write(&online_sem); krgnodes_clear(krgnode_online_map); kerrighed_nb_nodes = 0; + up_write(&online_sem); } static @@ -71,6 +113,10 @@ int membership_present_notification(struct notifier_block *nb, int hotplug_membership_init(void) { + online_barrier = alloc_cluster_barrier(ONLINE_HOTPLUG_BARRIER); + if (IS_ERR(online_barrier)) + panic("kerrighed: Couldn't alloc online_barrier!\n"); + register_hotplug_notifier(membership_present_notification, HOTPLUG_PRIO_MEMBERSHIP_PRESENT); register_hotplug_notifier(membership_online_notification, commit 5dff30da37d4a3025802574679d0ba8407d1a2c1 Author: Louis Rilling <lou...@ke...> Date: Wed Jun 23 14:29:30 2010 +0200 Introduce down_read_trylock_non_owner() Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h index efd348f..14f3611 100644 --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h @@ -80,11 +80,13 @@ extern void down_write_nested(struct rw_semaphore *sem, int subclass); * proper abstraction for this case is completions. ] */ extern void down_read_non_owner(struct rw_semaphore *sem); +extern int down_read_trylock_non_owner(struct rw_semaphore *sem); extern void up_read_non_owner(struct rw_semaphore *sem); #else # define down_read_nested(sem, subclass) down_read(sem) # define down_write_nested(sem, subclass) down_write(sem) # define down_read_non_owner(sem) down_read(sem) +# define down_read_trylock_non_owner(sem) down_read_trylock(sem) # define up_read_non_owner(sem) up_read(sem) #endif diff --git a/kernel/rwsem.c b/kernel/rwsem.c index cae050b..dcac142 100644 --- a/kernel/rwsem.c +++ b/kernel/rwsem.c @@ -126,6 +126,13 @@ void down_read_non_owner(struct rw_semaphore *sem) EXPORT_SYMBOL(down_read_non_owner); +int down_read_trylock_non_owner(struct rw_semaphore *sem) +{ + return __down_read_trylock(sem); +} + +EXPORT_SYMBOL(down_read_trylock_non_owner); + void down_write_nested(struct rw_semaphore *sem, int subclass) { might_sleep(); commit c229cdad8e5fe9bd57a49fe6148b291fef354f91 Author: Louis Rilling <lou...@ke...> Date: Tue Nov 3 11:44:17 2009 +0100 hotplug/remove: Call init_cluster_barrier() before init_hotplug() Next commit will make init_hotplug() depend on init_cluster_barrier(). Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/kerrighed/hotplug/krginit.c b/kerrighed/hotplug/krginit.c index 950159d..b84f780 10... [truncated message content] |
From: alebre <al...@us...> - 2010-07-06 12:27:58
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "UNNAMED PROJECT". The branch, master has been updated via e85c92f17d0969a80f3e9ea0a0147ee14b215772 (commit) via d597f02623bdf4295087672a75cf1d302737a72e (commit) from a215039789e86a5d1e4f8f79cb4bb80c4649fefa (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e85c92f17d0969a80f3e9ea0a0147ee14b215772 Merge: d597f02 a215039 Author: root <root@krgserver.dirty.world> Date: Tue Jul 6 14:26:27 2010 +0000 Merge branch 'master' of ssh://kdfs.git.sourceforge.net/gitroot/kdfs/tools commit d597f02623bdf4295087672a75cf1d302737a72e Author: root <root@krgserver.dirty.world> Date: Tue Jul 6 14:21:29 2010 +0000 add compilation script diff --git a/scripts/compile-tools b/scripts/compile-tools new file mode 100755 index 0000000..907b3df --- /dev/null +++ b/scripts/compile-tools @@ -0,0 +1,4 @@ +./autogen.sh + ./configure --disable-kernel +make +sudo make install ----------------------------------------------------------------------- Summary of changes: scripts/compile-tools | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) create mode 100755 scripts/compile-tools hooks/post-receive -- UNNAMED PROJECT |
From: Marko O. <d0...@us...> - 2010-05-10 13:17:46
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "UNNAMED PROJECT". The branch, master has been updated via a215039789e86a5d1e4f8f79cb4bb80c4649fefa (commit) via 486ac20ff0a03f1d8ce39d904d2c37f9b5fbd863 (commit) via b9386ae7c235c5b138b418a16b0f2374fd43e0a5 (commit) via b5c435951e2dcf142eb324cb32e00aac64db9d37 (commit) via f32f65208ef4ac8461c0bfcf5ece03f5762db9f6 (commit) via 097206745a62011ac2149286ea2951787ed86f91 (commit) via e6e9ba3f50e5577bfde30b09bba4bc3db540cb83 (commit) via a837fbe063d648496bb52913d3855d517a0abf38 (commit) via 60a45f10a90c775b09c4c1175737c7d13b1d808f (commit) via a05c680e72321c4050d95bab90189f71e405eec6 (commit) via 596d2e6fabad5fad30a97208e805b6aba5527e5a (commit) via 20b72c5712553a4915e23ff71d28183594828c58 (commit) via 30b090c71a3a822cd6c834d5101c1cedc86ad702 (commit) via 5dbf3667b7f3a4b88f726e777801468bb148d73f (commit) via 388d87c8843c052aef2ff7e7ff60481a3bc6966c (commit) via 0c75f669a94afd89a7c2ff258d8c383ae4dc0454 (commit) via b218993dd55d0b67678cba58980f0b056a758e2b (commit) via 8937cd62a5ce170f3fade59ab95b3533228015ff (commit) via c66a74d81462ab502cc62f78fa2057a7a64f70cf (commit) via d27dcb4861c29aef2b1404a28a3de8e1799ced45 (commit) via fe7ee93cf6f05cd110a999afdfd96094aefd6ccc (commit) via 93d31cf4afa0878adb8bdbade6254ca6e38e34ce (commit) via 86082d92ddcffafb621d172cd9fcc67db5f2fc81 (commit) via 0e7e9129358f813281ee9880079c064dbc853a7e (commit) via 4239a416a8e86a96e4a67430718fa4066fc64be1 (commit) via 4639e375cc08817d85e7733d8551ceec69c3ae1c (commit) via b6732c147efec4ab634685a8fa55d67f674ac053 (commit) via 459a6da9fa601aacb98a054eb3b998026e88fea8 (commit) via 8d44bc9d49b065c84dade8515262385bc2e94190 (commit) from 1593fa67a18a602c629d4977e63f7c58aa5c0175 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a215039789e86a5d1e4f8f79cb4bb80c4649fefa Author: Marko Obrovac <mar...@in...> Date: Mon May 10 17:16:46 2010 +0200 BUGFIX: * Add kdfs_stat and netclient as build targets diff --git a/tools/Makefile.am b/tools/Makefile.am index e5d3222..839edb6 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -11,7 +11,7 @@ sbindir=$(exec-prefix)/sbin dist_sbin_SCRIPTS = krginit_helper krg_legacy_scheduler bin_PROGRAMS = migrate checkpoint restart krgcapset krgcr-run ipccheckpoint ipcrestart -sbin_PROGRAMS = krgadm krginit mkfs.kdfs +sbin_PROGRAMS = krgadm krginit mkfs.kdfs kdfs_stat netclient INCLUDES = -I@top_srcdir@/libs/include LDADD = @top_builddir@/libs/libkerrighed/libkerrighed.la @top_builddir@/libs/libkrgcb/libkrgcb.la commit 486ac20ff0a03f1d8ce39d904d2c37f9b5fbd863 Merge: 1593fa6 b9386ae Author: Marko Obrovac <mar...@in...> Date: Mon May 10 17:07:34 2010 +0200 Merge branch 'master' of git://mirrors.git.kernel.org/cluster/kerrighed/tools commit b9386ae7c235c5b138b418a16b0f2374fd43e0a5 Author: Jean Parpaillon <jea...@ke...> Date: Wed May 5 14:03:02 2010 +0200 [tools] Update init scripts for new cluster start method diff --git a/tools/kerrighed.default b/tools/kerrighed.default index 9fa7662..dbdafa2 100644 --- a/tools/kerrighed.default +++ b/tools/kerrighed.default @@ -3,16 +3,12 @@ # #===================================================== -# Start kerrighed cluster -ENABLE=true -#ENABLE=false - # krgadm nodes add options. Can be used to wait for some nodes. # If empty, no nodes is added to the cluster. # See man krgadm(1) -START_OPTS="--all" -#START_OPTS="--count 4" -#START_OPTS="--nodes 1-4" +ADD_OPTS="--all" +#ADD_OPTS="--total 4" +#ADD_OPTS="--nodes 1-4" # Enable/Disable legacy scheduler behaviour LEGACY_SCHED=true diff --git a/tools/kerrighed.init b/tools/kerrighed.init index ff1d927..bdf1795 100755 --- a/tools/kerrighed.init +++ b/tools/kerrighed.init @@ -46,17 +46,12 @@ d_check_kerrighed() { return $? } -d_trigger_krg_legacy_scheduler() { - krgadm cluster wait_start - krg_legacy_scheduler > /dev/null 2>&1 -} - d_start_scheduler() { log_progress_msg "scheduler" case "x$LEGACY_SCHED" in xtrue) - d_trigger_krg_legacy_scheduler & + krg_legacy_scheduler > /dev/null 2>&1 ;; xfalse) log_progress_msg "disabled in $CFG" @@ -76,32 +71,12 @@ d_start_scheduler() { d_start() { log_daemon_msg "Starting $DESC" - if krgadm cluster status | grep -q '^status: up'; then - log_progress_msg "already started" - STATUS=1 - else - case "x$ENABLE" in - xtrue) - log_progress_msg "cluster" - krgadm cluster start > /dev/null - STATUS=$? - if [ $STATUS -eq 0 ]; then - if [ -n "$START_OPTS" ]; then - krgadm nodes add $START_OPTS > /dev/null - STATUS=$? - fi - d_start_scheduler - fi - ;; - xfalse) - log_progress_msg "disabled in $CFG" - ;; - *) - log_progress_msg "value of ENABLE in $CFG must be either 'true' or 'false'" - STATUS=1 - ;; - esac + if [ -n "$ADD_OPTS" ]; then + log_daemon_msg "nodes" + krgadm nodes add $ADD_OPTS > /dev/null + STATUS=$? fi + d_start_scheduler log_end_msg ${STATUS:-0} return $? commit b5c435951e2dcf142eb324cb32e00aac64db9d37 Author: Jean Parpaillon <jea...@ke...> Date: Thu May 6 14:02:37 2010 +0200 [tests] Remove wait_start call from krgltp-smp.sh diff --git a/tests/ktp/krgltp-smp.sh.in b/tests/ktp/krgltp-smp.sh.in index 754015b..0f31920 100755 --- a/tests/ktp/krgltp-smp.sh.in +++ b/tests/ktp/krgltp-smp.sh.in @@ -1837,12 +1837,6 @@ fi slab-check -# Use the distant fork feature -if [ -z "$localonly" ]; then - echo "* Waiting for the cluster to start" - krgadm cluster wait_start -fi - export KTP_NR_PS=$nr_ps export KTP_ROOT_PID=$$ commit f32f65208ef4ac8461c0bfcf5ece03f5762db9f6 Author: Jean Parpaillon <jea...@ke...> Date: Wed May 5 10:50:03 2010 +0200 [libkerrighed] Kill cluster_start and relative functions diff --git a/libs/include/hotplug.h b/libs/include/hotplug.h index 5100c28..94ff078 100644 --- a/libs/include/hotplug.h +++ b/libs/include/hotplug.h @@ -225,9 +225,6 @@ int krg_nodes_poweroff(struct krg_node_set *node_set); struct krg_nodes* krg_nodes_status(void); struct krg_clusters* krg_cluster_status(void); int krg_set_cluster_creator(int enable); -int krg_cluster_start(struct krg_node_set *krg_node_set); -int krg_cluster_start_all(void); -int krg_cluster_wait_for_start(void); int krg_node_ready(int setup_ok); int krg_cluster_shutdown(int subclusterid); int krg_cluster_reboot(int subclusterid); diff --git a/libs/include/kerrighed_tools.h b/libs/include/kerrighed_tools.h index 7854797..3fd9f8d 100644 --- a/libs/include/kerrighed_tools.h +++ b/libs/include/kerrighed_tools.h @@ -74,9 +74,6 @@ #define KSYS_GET_NODES_COUNT _IOR(KERRIGHED_PROC_MAGIC, \ COMM_PROC_BASE + 1, \ int) -#define KSYS_HOTPLUG_START _IOW(KERRIGHED_PROC_MAGIC, \ - COMM_PROC_BASE + 3, \ - krgnodemask_t) #define KSYS_HOTPLUG_RESTART _IOW(KERRIGHED_PROC_MAGIC, \ COMM_PROC_BASE + 4, \ krgnodemask_t) @@ -104,8 +101,6 @@ #define KSYS_HOTPLUG_POWEROFF _IOW(KERRIGHED_PROC_MAGIC, \ COMM_PROC_BASE + 12, \ struct hotplug_node_set) -#define KSYS_HOTPLUG_WAIT_FOR_START _IO(KERRIGHED_PROC_MAGIC, \ - COMM_PROC_BASE + 13) #define KSYS_HOTPLUG_SET_CREATOR _IO(KERRIGHED_PROC_MAGIC, \ COMM_PROC_BASE + 14) #define KSYS_HOTPLUG_READY _IO(KERRIGHED_PROC_MAGIC, \ diff --git a/libs/kerrighed.py b/libs/kerrighed.py index 83e6f10..346f051 100644 --- a/libs/kerrighed.py +++ b/libs/kerrighed.py @@ -89,9 +89,6 @@ libkerrighed.krg_node_set_next.restype = c_int libkerrighed.krg_status_str.restype = c_char_p libkerrighed.krg_nodes_status.restype = krg_nodes_ptr_t libkerrighed.krg_cluster_status.restype = krg_clusters_ptr_t -libkerrighed.krg_cluster_start.restype = krg_error_handler(libkerrighed.krg_cluster_start) -libkerrighed.krg_cluster_start_all.restype = krg_error_handler(libkerrighed.krg_cluster_start_all) -libkerrighed.krg_cluster_wait_for_start.restype = krg_error_handler(libkerrighed.krg_cluster_wait_for_start) libkerrighed.krg_cluster_shutdown.restype = krg_error_handler(libkerrighed.krg_cluster_shutdown) libkerrighed.krg_cluster_reboot.restype = krg_error_handler(libkerrighed.krg_cluster_reboot) @@ -282,18 +279,6 @@ def krg_cluster_status(): """ return krg_clusters(libkerrighed.krg_cluster_status()) -def krg_cluster_start(node_set): - """ - node_set: krg_node_set object - """ - libkerrighed.krg_cluster_start(node_set.c)==0 - -def krg_cluster_start_all(): - libkerrighed.krg_cluster_start_all() - -def krg_cluster_wait_for_start(): - libkerrighed.krg_cluster_wait_for_start() - def krg_cluster_shutdown(subclusterid=0): """ subclusterid: int diff --git a/libs/libkerrighed/libhotplug.c b/libs/libkerrighed/libhotplug.c index e1d2c4a..cd5d404 100644 --- a/libs/libkerrighed/libhotplug.c +++ b/libs/libkerrighed/libhotplug.c @@ -499,57 +499,6 @@ int krg_set_cluster_creator(int enable) enable ? (void *)1 : NULL); } -int krg_cluster_start(struct krg_node_set *krg_node_set){ - struct hotplug_node_set node_set; - struct krg_clusters* clusters; - int i; - - clusters = krg_cluster_status(); - if (krg_clusters_is_up(clusters, 0)) { - errno = EALREADY; - return -1; - } - - node_set.subclusterid = krg_node_set->subclusterid; - - krgnodes_clear(node_set.v); - - for (i = 0; i < kerrighed_max_nodes; i++) { - if (krg_node_set->v[i]) { - krgnode_set(i, node_set.v); - } - } - - return call_kerrighed_services(KSYS_HOTPLUG_START, &node_set); -} - -int krg_cluster_start_all(void) -{ - struct krg_nodes* status; - struct krg_node_set* nodes; - int r = -1; - - status = krg_nodes_status(); - if(! status) - return r; - - nodes = krg_nodes_get_present(status); - if (! nodes) - krg_nodes_destroy(status); - return r; - r = krg_cluster_start(nodes); - - krg_nodes_destroy(status); - krg_node_set_destroy(nodes); - - return r; -} - -int krg_cluster_wait_for_start(void) -{ - return call_kerrighed_services(KSYS_HOTPLUG_WAIT_FOR_START, NULL); -} - int krg_node_ready(int setup_ok) { return call_kerrighed_services(KSYS_HOTPLUG_READY, commit 097206745a62011ac2149286ea2951787ed86f91 Author: Jean Parpaillon <jea...@ke...> Date: Tue May 4 19:05:52 2010 +0200 [man] Update krgadm manpage diff --git a/man/krgadm.1.xml b/man/krgadm.1.xml index 99b6c7d..dad5094 100644 --- a/man/krgadm.1.xml +++ b/man/krgadm.1.xml @@ -19,7 +19,6 @@ <arg choice="plain">--help</arg> </group> <group choice="opt" > - <arg choice="plain">-v</arg> <arg choice="plain">--version</arg> </group> </cmdsynopsis> @@ -27,9 +26,7 @@ <command>krgadm</command> <arg choice="plain" >cluster</arg> <group choice="req" > - <arg choice="plain">start</arg> <arg choice="plain">status</arg> - <arg choice="plain">wait_start</arg> <arg choice="plain">poweroff</arg> <arg choice="plain">reboot</arg> </group> @@ -37,10 +34,13 @@ <cmdsynopsis> <command>krgadm</command> <arg choice="plain">nodes status</arg> - <group choice="opt" > - <arg choice="plain" >-n</arg> - <arg choice="plain" >--nodes <replaceable>node_list</replaceable></arg> - </group> + <arg choice="opt" > + <group choice="plain" > + <arg choice="plain" >-n</arg> + <arg choice="plain" >--nodes</arg> + </group> + <replaceable>node_list</replaceable> + </arg> </cmdsynopsis> <cmdsynopsis> <command>krgadm</command> @@ -49,14 +49,27 @@ <arg choice="plain">add</arg> <arg choice="plain">del</arg> </group> - <group choice="opt" > - <arg choice="plain" >-n</arg> - <arg choice="plain" >--nodes <replaceable>node_list</replaceable></arg> - </group> - <group choice="opt" > - <arg choice="plain" >-c</arg> - <arg choice="plain" >--count <replaceable>node_count</replaceable></arg> - </group> + <arg choice="opt" > + <group choice="plain" > + <arg choice="plain" >-n</arg> + <arg choice="plain" >--nodes</arg> + </group> + <replaceable>node_list</replaceable> + </arg> + <arg choice="opt" > + <group choice="plain" > + <arg choice="plain" >-c</arg> + <arg choice="plain" >--count</arg> + </group> + <replaceable>node_count</replaceable> + </arg> + <arg choice="opt" > + <group choice="plain" > + <arg choice="plain" >-t</arg> + <arg choice="plain" >--total</arg> + </group> + <replaceable>node_count</replaceable> + </arg> <group choice="opt" > <arg choice="plain" >-a</arg> <arg choice="plain" >--all</arg> @@ -67,13 +80,13 @@ <refsect1> <title>Description</title> <para> - <command>krgadm</command> allows the user to manage a Kerrighed - cluster by starting or stopping the cluster. + <command>krgadm</command> allows the user to manage Kerrighed + nodes. </para> - + <para> - Each <command>krgadm</command> invocation is followed by a command and some options - relative to this mode. + Each <command>krgadm</command> invocation is followed by a + command and some options relative to this mode. </para> </refsect1> @@ -89,7 +102,6 @@ </listitem> </varlistentry> <varlistentry> - <term>-v</term> <term>--version</term> <listitem> <para>Print version informations and exit</para> @@ -124,28 +136,12 @@ <para> <variablelist> <varlistentry> - <term> - <arg choice="plain" >start</arg> - </term> - <listitem> - <para> - Start the cluster on the current node. - </para> - </listitem> - </varlistentry> - <varlistentry> <term>status</term> <listitem> <para>Print cluster status</para> </listitem> </varlistentry> <varlistentry> - <term>wait_start</term> - <listitem> - <para>Return once cluster is started</para> - </listitem> - </varlistentry> - <varlistentry> <term>poweroff</term> <listitem> <para>Power off all nodes belonging to the cluster</para> @@ -193,6 +189,10 @@ <arg choice="plain" >--count <replaceable>node_count</replaceable></arg> </group> <group choice="opt" > + <arg choice="plain" >-t</arg> + <arg choice="plain" >--total <replaceable>node_count</replaceable></arg> + </group> + <group choice="opt" > <arg choice="plain" >-a</arg> <arg choice="plain" >--all</arg> </group> @@ -212,12 +212,20 @@ them to the running cluster. </para> <para> + With the <arg choice="plain" >--total</arg> option, add + enough nodes to get the given number of nodes in the + resulting cluster. Wait for nodes to be present if + necessary. + </para> + <para> With the <arg choice="plain" >--all</arg> option, add all the available node (state present) to the running cluster. </para> <para> - One of the options <arg choice="plain" >--nodes</arg>, <arg choice="plain" >--count</arg> + One and only one of the + options <arg choice="plain">--nodes</arg>, <arg choice="plain">--count</arg>, + <arg choice="plain">--total</arg> or <arg choice="plain" >--all</arg> must be used. </para> </listitem> @@ -234,6 +242,10 @@ <arg choice="plain" >--count <replaceable>node_count</replaceable></arg> </group> <group choice="opt" > + <arg choice="plain" >-t</arg> + <arg choice="plain" >--total <replaceable>node_count</replaceable></arg> + </group> + <group choice="opt" > <arg choice="plain" >-a</arg> <arg choice="plain" >--all</arg> </group> @@ -253,11 +265,17 @@ if there are no such nodes. </para> <para> + With the <arg choice="plain" >--total</arg> option, + remove enough nodes to get given number of nodes in the + resulting cluster. Fail if there are no such nodes. + </para> + <para> With the <arg choice="plain" >--all</arg> option, remove all nodes of the cluster, except current one. </para> <para> - One of the options <arg choice="plain" >--nodes</arg>, <arg choice="plain" >--count</arg> + One and only one of the + options <arg choice="plain">--nodes</arg>, <arg choice="plain">--count</arg>, <arg choice="plain">--total</arg> or <arg choice="plain" >--all</arg> must be used. </para> </listitem> commit e6e9ba3f50e5577bfde30b09bba4bc3db540cb83 Author: Jean Parpaillon <jea...@ke...> Date: Tue May 4 18:58:39 2010 +0200 [tools] Update krgadm bash completion diff --git a/tools/kerrighed.completion b/tools/kerrighed.completion index 30bf8bc..53e3368 100644 --- a/tools/kerrighed.completion +++ b/tools/kerrighed.completion @@ -59,11 +59,11 @@ _krgadm() local cur=$2 prev=$3 local modes='cluster nodes' - local cluster_actions='status start wait_start poweroff reboot' + local cluster_actions='status poweroff reboot' local nodes_actions='status add del' - local nodes_status_opts='-n --nodes' - local nodes_opts='-n --nodes -c --count -a --all' - local options='--help -h' + local nodes_status_opts='-n --nodes -a --all' + local nodes_opts='-n --nodes -c --count -t --total -a --all' + local options='--help -h --version' COMPREPLY=() @@ -87,8 +87,16 @@ _krgadm() return 0 ;; -n|--nodes) - _nodes 'possible' - return 0 + case "${COMP_WORDS[COMP_CWORD-2]}" in + "add"|"status") + _nodes 'possible' + return 0 + ;; + "del") + _nodes 'online' + return 0 + ;; + esac ;; *) case "${COMP_WORDS[1]}" in @@ -98,18 +106,12 @@ _krgadm() nodes) return 0 ;; + *) + COMPREPLY=( $(compgen -W "${options} ${modes}" -- ${cur} ) ) esac ;; esac - if [[ "${cur}" == -* ]]; then - # return one of the possible options - COMPREPLY=( $(compgen -W "${options}" -- ${cur} ) ) - else - # return one of the possible modes - COMPREPLY=( $(compgen -W "${modes}" -- ${cur}) ) - fi - return 0 } [ -n "${have:-}" ] && complete -F _krgadm krgadm commit a837fbe063d648496bb52913d3855d517a0abf38 Author: Jean Parpaillon <jea...@ke...> Date: Tue May 4 18:37:22 2010 +0200 [tools] Remove wait_start command diff --git a/tools/krgadm.c b/tools/krgadm.c index 587dc2b..6e28790 100644 --- a/tools/krgadm.c +++ b/tools/krgadm.c @@ -16,7 +16,6 @@ enum { NONE, STATUS, - WAIT_START, ADD, DEL, POWEROFF, @@ -64,14 +63,13 @@ void help(char * program_name) { printf("\ Usage: %s [-h|--help] [--version]\n\ - or: %s cluster {status|wait_start|poweroff|reboot}\n\ + or: %s cluster {status|poweroff|reboot}\n\ or: %s nodes status [-n|--nodes]\n\ or: %s nodes {add|del} {(-n|--nodes node_list) | (-c|--count node_count) | (-t|--total node_count) |(-a|--all)}\n", program_name, program_name, program_name, program_name); printf("\n\ Cluster Mode:\n\ status print cluster status\n\ - wait_start return when cluster is started\n\ poweroff poweroff all nodes in the cluster\n\ reboot restart all nodes in the cluster\n\ \n\ @@ -325,7 +323,7 @@ int nodes_status(struct krg_node_set* node_set, enum mode_t mode) perror("Error adding nodes"); return -1; } - + if (mode == NODES_MODE_ALL) { /* Add all nodes with status PRESENT or ONLINE */ node_set = krg_node_set_create(); @@ -545,8 +543,6 @@ int cluster(int argc, char* argv[], char* program_name) if(argc == 0 || ! strcmp(*argv, "status")) action = STATUS; - else if(! strcmp(*argv, "wait_start")) - action = WAIT_START; else if(! strcmp(*argv, "poweroff")) action = POWEROFF; else if(! strcmp(*argv, "reboot")) @@ -568,16 +564,6 @@ int cluster(int argc, char* argv[], char* program_name) printf("up on %d nodes\n", r); } break; - case WAIT_START: - printf("Waiting for cluster to start... "); - fflush(stdout); - r = krg_cluster_wait_for_start(); - if (r == -1) { - printf("fail (%s)\n", strerror(errno)); - ret = EXIT_FAILURE; - } else - printf("done\n"); - break; case POWEROFF: printf("Shutting down cluster... "); fflush(stdout); commit 60a45f10a90c775b09c4c1175737c7d13b1d808f Author: Jean Parpaillon <jea...@ke...> Date: Tue May 4 17:55:12 2010 +0200 [tools] Add --total option to krgadm --total option allow to add/remove nodes giving resulting wanted cluster diff --git a/tools/krgadm.c b/tools/krgadm.c index 6f47c6f..587dc2b 100644 --- a/tools/krgadm.c +++ b/tools/krgadm.c @@ -23,10 +23,12 @@ enum { REBOOT, }; -enum { - NB_NODES_UNSET = -2, - NB_NODES_ALL = -1, - NB_NODES_LIST = 0, +enum mode_t { + NODES_MODE_UNSET, + NODES_MODE_ALL, + NODES_MODE_COUNT, + NODES_MODE_TOTAL, + NODES_MODE_LIST, }; #define NODE_SEP ',' @@ -34,11 +36,16 @@ enum { #define POLL_NODES 1 #define NODES_OPTION "nodes", required_argument, NULL, 'n' #define COUNT_OPTION "count", required_argument, NULL, 'c' +#define TOTAL_OPTION "total", required_argument, NULL, 't' #define ALL_OPTION "all", no_argument, NULL, 'a' +#define MSG_EXCLUSIVE_OPTIONS "Only one of --all, --count, --total or --nodes option is\n\ +supported. Aborting.\n" + static struct option nodes_mode_options[] = { {NODES_OPTION}, {COUNT_OPTION}, + {TOTAL_OPTION}, {ALL_OPTION}, {NULL, 0, NULL, 0} }; @@ -59,7 +66,7 @@ void help(char * program_name) Usage: %s [-h|--help] [--version]\n\ or: %s cluster {status|wait_start|poweroff|reboot}\n\ or: %s nodes status [-n|--nodes]\n\ - or: %s nodes {add|del} {(-n|--nodes node_list) | (-c|--count node_count) | (-a|--all)}\n", + or: %s nodes {add|del} {(-n|--nodes node_list) | (-c|--count node_count) | (-t|--total node_count) |(-a|--all)}\n", program_name, program_name, program_name, program_name); printf("\n\ Cluster Mode:\n\ @@ -74,9 +81,10 @@ Nodes Mode:\n\ del remove nodes from the running cluster\n\ \n\ Options:\n\ - -n, --nodes list of nodes to apply action to\n\ + -n, --nodes list of nodes to add/del\n\ ie: 2,3,6-10,42-45\n\ - -c, --count number of nodes to apply action to\n\ + -c, --count number of nodes to add/del\n\ + -t, --total number of nodes in resulting cluster\n\ -a, --all apply to all nodes\n\ \n\ Node Status:\n\ @@ -192,8 +200,11 @@ int wait_for_nodes_count(int i, struct krg_node_set* node_set) int cur, r = 0; int nodes_count; - printf("Waiting for %d nodes to join... ", i); - fflush(stdout); + if (i > 0) { + printf("Waiting for %d nodes to join... ", i); + fflush(stdout); + } else + return 0; if (i < 1 || i > kerrighed_max_nodes) { r = -1; @@ -249,8 +260,11 @@ int wait_for_nodes(struct krg_node_set* node_set) struct krg_nodes* status; int bcl, r = 0, done, node_count; - printf("Waiting for nodes to join... "); - fflush(stdout); + if (krg_node_set_weight(node_set) > 0) { + printf("Waiting for nodes to join... "); + fflush(stdout); + } else + return 0; node_count = krg_node_set_weight(node_set); do { @@ -285,7 +299,7 @@ int wait_for_nodes(struct krg_node_set* node_set) } while (! done); exit: - if (r == 1) + if (r == 0) printf(" done\n"); else printf(" fail (%s)\n", strerror(errno)); @@ -296,11 +310,11 @@ exit: /* * nodes_status * - * Print status of nodes in node_set, or all nodes if nb_nodes == -1 + * Print status of nodes in node_set, or all nodes if mode == NODES_MODE_ALL * * Return 0 on success, -1 on failure */ -int nodes_status(struct krg_node_set* node_set, int nb_nodes) +int nodes_status(struct krg_node_set* node_set, enum mode_t mode) { struct krg_nodes* status; int bcl, node; @@ -312,8 +326,8 @@ int nodes_status(struct krg_node_set* node_set, int nb_nodes) return -1; } - if (nb_nodes == -1) { - /* If not specified add all nodes with status PRESENT or ONLINE */ + if (mode == NODES_MODE_ALL) { + /* Add all nodes with status PRESENT or ONLINE */ node_set = krg_node_set_create(); for (bcl = 0; bcl < kerrighed_max_nodes; bcl++) { if (status->nodes[bcl] > HOTPLUG_NODE_POSSIBLE) @@ -340,16 +354,18 @@ int nodes_status(struct krg_node_set* node_set, int nb_nodes) /* * nodes_add * - * If nb_nodes == NB_NODES_ALL, add all PRESENT nodes - * If nb_nodes == NB_NODES_LIST, add nodes in node_set - * If nb_nodes > 0, wait for nb_nodes nodes to be PRESENT, then add them + * If mode == NODES_MODE_ALL, add all PRESENT nodes + * If mode == NODES_MODE_LIST, add nodes in node_set + * If mode == NODES_MODE_COUNT, wait for n nodes to be PRESENT, then add them + * If mode == NODES_MODE_TOTAL, wait for n nodes to be PRESENT or ONLINE, + * then add PRESENT nodes. * * Return 0 on success, -1 on failure */ -int nodes_add(struct krg_node_set* node_set, int nb_nodes) +int nodes_add(struct krg_node_set* node_set, int n, enum mode_t mode) { struct krg_nodes* status; - int r = 0; + int node, r = 0; status = krg_nodes_status(); if (! status) { @@ -357,8 +373,8 @@ int nodes_add(struct krg_node_set* node_set, int nb_nodes) return -1; } - switch (nb_nodes) { - case NB_NODES_ALL: + switch (mode) { + case NODES_MODE_ALL: /* add all PRESENT nodes */ node_set = krg_nodes_get_present(status); if (! node_set) { @@ -368,18 +384,27 @@ int nodes_add(struct krg_node_set* node_set, int nb_nodes) return -1; } break; - case NB_NODES_LIST: + case NODES_MODE_LIST: + /* Remove online nodes from node_set */ + node = krg_node_set_next(node_set, -1); + while (node != -1) { + if (krg_nodes_is_online(status, node)) + krg_node_set_remove(node_set, node); + node = krg_node_set_next(node_set, node); + } + if (wait_for_nodes(node_set) == -1) return -1; break; - default: - /* If 'count' specified, wait for nodes to be present */ - if (nb_nodes < 1) - return -1; - + case NODES_MODE_TOTAL: + n -= krg_nodes_num_online(status); + case NODES_MODE_COUNT: node_set = krg_node_set_create(); - if (wait_for_nodes_count(nb_nodes, node_set) == -1) + if (wait_for_nodes_count(n, node_set) == -1) return -1; + break; + default: + return -1; } if (krg_node_set_weight(node_set) > 0) { @@ -398,13 +423,14 @@ int nodes_add(struct krg_node_set* node_set, int nb_nodes) /* * nodes_remove * - * If nb_nodes == NB_NODES_ALL, remove all ONLINE nodes except current one - * If nb_nodes == NB_NODES_LIST, remove nodes in node_set - * If nb_nodes > 0, remove nb_nodes ONLINE nodes + * If mode == NODES_MODE_ALL, remove all PRESENT nodes except current one + * If mode == NODES_MODE_LIST, remove nodes in node_set + * If mode == NODES_MODE_COUNT, remove n ONLINE nodes + * If mode == NODES_MODE_TOTAL, remove enough nodes for the cluster to contains n nodes * * Return 0 on success, -1 on failure */ -int nodes_remove(struct krg_node_set* node_set, int nb_nodes) +int nodes_remove(struct krg_node_set* node_set, int n, enum mode_t mode) { struct krg_nodes* status; int bcl, node, r = 0; @@ -415,15 +441,17 @@ int nodes_remove(struct krg_node_set* node_set, int nb_nodes) return -1; } - if (nb_nodes == NB_NODES_ALL) { + switch (mode) { + case NODES_MODE_ALL: /* remove all nodes except current */ node_set = krg_node_set_create(); for (bcl = 0; bcl < kerrighed_max_nodes; bcl++) { if (krg_nodes_is_online(status, bcl) && get_node_id() != bcl) krg_node_set_add(node_set, bcl); } - } else if (nb_nodes == NB_NODES_LIST) { - /* If list of nodes specified, check they are 'online', and not the current one */ + break; + case NODES_MODE_LIST: + /* check given nodes are 'online', and not the current one */ node = krg_node_set_next(node_set, -1); while (node != -1) { if (! krg_nodes_is_online(status, node)) { @@ -435,14 +463,17 @@ int nodes_remove(struct krg_node_set* node_set, int nb_nodes) } node = krg_node_set_next(node_set, node); } - } else if (nb_nodes > 0) { - /* If 'count' specified, remove 'nb_nodes' first online nodes */ + break; + case NODES_MODE_TOTAL: + n = krg_nodes_num_online(status) - n; + case NODES_MODE_COUNT: + /* remove 'n' first online nodes */ node_set = krg_nodes_get_online(status); - if (nb_nodes < krg_node_set_weight(node_set)) { + if (n < krg_node_set_weight(node_set)) { bcl = 0; node = krg_node_set_next(node_set, -1); while (node != -1) { - if (bcl < nb_nodes) + if (bcl < n) if (get_node_id() == node) krg_node_set_remove(node_set, node); else @@ -452,11 +483,13 @@ int nodes_remove(struct krg_node_set* node_set, int nb_nodes) node = krg_node_set_next(node_set, node); } } else { - printf("Can not remove so much nodes. Aborting.\n"); + printf("Not enough nodes to remove. Aborting.\n"); return -1; } - } else + break; + default: return -1; + } if (krg_node_set_weight(node_set) > 0) { printf("Removing nodes %s... ", node_set_str(node_set)); @@ -590,7 +623,8 @@ int nodes(int argc, char* argv[], char* program_name) struct krg_node_set* node_set = NULL; char* endptr; int c, option_index; - int nb_nodes = NB_NODES_UNSET; + enum mode_t mode = NODES_MODE_UNSET; + int nb_nodes = -1; int action = NONE; if ( krg_check_hotplug() ) { @@ -607,27 +641,29 @@ int nodes(int argc, char* argv[], char* program_name) else if(! strcmp(*argv, "del")) action = DEL; - while ((c = getopt_long(argc, argv, "n:c:a", + while ((c = getopt_long(argc, argv, "n:c:t:a", nodes_mode_options, &option_index)) != -1) { - switch (c) { - case 'n': - if (nb_nodes != NB_NODES_UNSET) { - printf("--nodes, --count and --all are mutually exclusive. Aborting.\n"); + if ( 'n' == c ) { + if (mode != NODES_MODE_UNSET) { + printf(MSG_EXCLUSIVE_OPTIONS); return EXIT_FAILURE; } + mode = NODES_MODE_LIST; - nb_nodes = NB_NODES_LIST; node_set = krg_node_set_create(); if (! node_set) return EXIT_FAILURE; if (parse_nodes(optarg, node_set) == -1) return EXIT_FAILURE; - break; - case 'c': - if (nb_nodes != NB_NODES_UNSET) { - printf("--nodes, --count and --all are mutually exclusive. Aborting.\n"); + } else if ( 'c' == c || 't' == c ) { + if (mode != NODES_MODE_UNSET) { + printf(MSG_EXCLUSIVE_OPTIONS); return EXIT_FAILURE; } + if ( 'c' == c ) + mode = NODES_MODE_COUNT; + else + mode = NODES_MODE_TOTAL; if (action == STATUS) { help(program_name); @@ -639,39 +675,37 @@ int nodes(int argc, char* argv[], char* program_name) perror("nodes number"); return EXIT_FAILURE; } - break; - case 'a': - if (nb_nodes != NB_NODES_UNSET) { - printf("--nodes, --count and --all are mutually exclusive. Aborting.\n"); + } else if ( 'a' == c ) { + if (mode != NODES_MODE_UNSET) { + printf(MSG_EXCLUSIVE_OPTIONS); return EXIT_FAILURE; } - nb_nodes = NB_NODES_ALL; - break; - default: + mode = NODES_MODE_ALL; + } else { help(program_name); return EXIT_FAILURE; } } - if (action == STATUS && nb_nodes == NB_NODES_UNSET) - nb_nodes = NB_NODES_ALL; - - if (nb_nodes == NB_NODES_UNSET) { + if ( (action == ADD || action == DEL) && mode == NODES_MODE_UNSET ) { + /* ADD and DEL actions requires a mode */ help(program_name); return EXIT_FAILURE; } switch (action) { case STATUS: - if (nodes_status(node_set, nb_nodes) == -1) + if (mode == NODES_MODE_UNSET) + mode = NODES_MODE_ALL; + if (nodes_status(node_set, mode) == -1) return EXIT_FAILURE; break; case ADD: - if (nodes_add(node_set, nb_nodes) == -1) + if (nodes_add(node_set, nb_nodes, mode) == -1) return EXIT_FAILURE; break; case DEL: - if (nodes_remove(node_set, nb_nodes) == -1) + if (nodes_remove(node_set, nb_nodes, mode) == -1) return EXIT_FAILURE; break; default: commit a05c680e72321c4050d95bab90189f71e405eec6 Author: Jean Parpaillon <jea...@ke...> Date: Tue May 4 11:21:33 2010 +0200 [tools] Remove start command from krgadm diff --git a/tools/krgadm.c b/tools/krgadm.c index a99f43c..6f47c6f 100644 --- a/tools/krgadm.c +++ b/tools/krgadm.c @@ -16,7 +16,6 @@ enum { NONE, STATUS, - START, WAIT_START, ADD, DEL, @@ -58,13 +57,12 @@ void help(char * program_name) { printf("\ Usage: %s [-h|--help] [--version]\n\ - or: %s cluster {start|status|wait_start|poweroff|reboot}\n\ + or: %s cluster {status|wait_start|poweroff|reboot}\n\ or: %s nodes status [-n|--nodes]\n\ or: %s nodes {add|del} {(-n|--nodes node_list) | (-c|--count node_count) | (-a|--all)}\n", program_name, program_name, program_name, program_name); printf("\n\ Cluster Mode:\n\ - start start the cluster\n\ status print cluster status\n\ wait_start return when cluster is started\n\ poweroff poweroff all nodes in the cluster\n\ @@ -497,38 +495,6 @@ exit: } /* - * Return 0 on success, -1 on failure - */ -int cluster_start(void) -{ - struct krg_node_set* node_set; - int ret = 0; - - if (cluster_status() > 0) { - errno = EALREADY; - fprintf(stderr, "Kerrighed is already running.\n"); - return -1; - } - - node_set = krg_node_set_create(); - if (! node_set) - return -1; - - /* Start cluster with current node */ - krg_node_set_add(node_set, get_node_id()); - - printf("Starting cluster... "); - fflush(stdout); - if (krg_cluster_start(node_set) == -1) { - printf("fail (%s)\n", strerror(errno)); - ret = -1; - } else - printf("done\n"); - - return ret; -} - -/* * Return EXIT_SUCCESS on success, EXIT_FAILURE on failure. */ int cluster(int argc, char* argv[], char* program_name) @@ -546,8 +512,6 @@ int cluster(int argc, char* argv[], char* program_name) if(argc == 0 || ! strcmp(*argv, "status")) action = STATUS; - else if(! strcmp(*argv, "start")) - action = START; else if(! strcmp(*argv, "wait_start")) action = WAIT_START; else if(! strcmp(*argv, "poweroff")) @@ -571,11 +535,6 @@ int cluster(int argc, char* argv[], char* program_name) printf("up on %d nodes\n", r); } break; - case START: - r = cluster_start(); - if (r == -1) - ret = EXIT_FAILURE; - break; case WAIT_START: printf("Waiting for cluster to start... "); fflush(stdout); commit 596d2e6fabad5fad30a97208e805b6aba5527e5a Merge: 20b72c5 86082d9 Author: Jean Parpaillon <jea...@ke...> Date: Fri May 7 17:39:53 2010 +0200 Merge branch 'master' of ssh://git.kerlabs.com/git/interne/kerrighed-tools commit 20b72c5712553a4915e23ff71d28183594828c58 Author: Jean Parpaillon <jea...@ke...> Date: Fri May 7 09:47:36 2010 +0200 Update ChangeLog diff --git a/ChangeLog b/ChangeLog index 65757dc..a6da7a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ + * [kernel] Port to linux 2.6.30 Features: Checkpoint/restart * Add various options to checkpoint and restart commit 30b090c71a3a822cd6c834d5101c1cedc86ad702 Author: Jean Parpaillon <jea...@ke...> Date: Wed May 5 17:24:39 2010 +0200 Update INSTALL file diff --git a/INSTALL b/INSTALL index 3b88316..ce841be 100644 --- a/INSTALL +++ b/INSTALL @@ -9,14 +9,19 @@ Table of contents ================= 1/ Pre-requisites -2/ Quick install -3/ Detailed configuration -3.1/ Generic configure options +2/ Quick Install +3/ Detailed Configuration +3.1/ Generic Configure Options 3.2/ Installation Names 3.3/ Operation Controls -3.4/ Specific configure options -3.5/ Build from outside of source dir +3.4/ Specific Configure Options +3.5/ Build from Outside of Source Dir +3.6/ Developer Tips +3.7/ Kernel Options Hints 4/ Starting Kerrighed +4.1/ New Kerrighed Architecture +4.2/ Quick Setup +4.3/ Kernel Configuration 1/ Pre-requisites ================= @@ -36,33 +41,54 @@ Table of contents Optional features requires the following: -- xsltproc : allow to create documentation in various formats (only needed by - maintainer. -- Python (>= 2.5) : Python interface is provided to libkerrighed (hotplug part) +- xsltproc : allow to create documentation in various formats (only needed by + maintainer). +- Python (>= 2.5) : to allow installation of the libkerrighed Python wrapper. 2/ Quick install ================ -Type the following in the base directory of the Kerrighed -distribution: +- Let's say this tarball have been uncompressed in '/usr/src/kerrighed-src' + +- Optionally, download linux-2.6.30 sources tarball into + '/usr/src'. If not 'configure' script will do it for you each and + every time. + +- Configure the sources: + % cd /usr/src/kerrighed-src && ./configure --sysconfdir=/etc + +- Configure the kernel. `./configure' setup the kernel with a default + configuration which may not suit your need but gives you a running + Kerrighed configuration. + + `configure' --with-kernel-* options can be given to configure kernel + sources, either with a `.config' file either with one of kernel's + *config targets. + + Type `./configure --help' for possible options. - % ./configure - % make - % make install + For some hints on kernel options, have a look at 'Kernel options' + section below. -3/ Detailed configuration +- Build the sources: + % make + +- Install all, as user root: + % make install + +3/ Detailed Configuration ========================= Kerrighed is made of several parts which can be built and installed -independently: + independently: -- kerrighed kernel (modified Linux kernel) -- libs -- tools -- scripts -- tests + - kerrighed kernel (modified Linux kernel) + - libs + - tools + - scripts + - tests -3.1/ Generic configure options +3.1/ Generic Configure Options ============================== The `configure' shell script attempts to guess correct values for @@ -70,8 +96,8 @@ various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, a file -`config.cache' that saves the results of its tests to speed up +you can run in the future to recreate the current configuration, a +file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). @@ -120,7 +146,13 @@ operates. Print the version of Autoconf used to generate the `configure' script, and exit. -3.4/ Specific configure options +`--enable-silent-rules' + Less verbose build output (undo: `make V=1') + +`--disable-silent-rules' + verbose build output (undo: `make V=0') + +3.4/ Specific Configure Options ===================================== Following options can be passed to the configure script: @@ -130,7 +162,8 @@ operates. --disable-libkerrighed Disable libkerrighed [default=enable] --disable-python Disable Python code [default=enable] --disable-tools Disable tools [default=enable] - --enable-host-tools Enable Kerrighed host service [default=disable] + --disable-host-tools Disable Kerrighed host service [default=enable] + --enable-preserve-conf Preserve configuration files if exist [default=disable] --enable-tests Globally enable tests [default=disable] --disable-tests-ktp Disable 'ktp' tests --disable-tests-apps Disable 'apps' tests @@ -149,10 +182,119 @@ operates. [default=none] --with-ltp-base Path to ltp base dir [default=DATAROOTDIR/ltp] -3.5/ Build from outside of source tree +3.5/ Build From Outside of Source Tree ====================================== Compilation and installation can be done from outside of source dir. - Just create a new directory where you want to build and cd into it. Call - configure script from this dir. - All make targets can be used as usual. + Just create a new directory where you want to build and cd into + it. Call configure script from this dir. All make targets can be + used as usual. + +3.6/ Developer Tips +=================== + +Kernel source dir is '_kernel'. If not present, 'configure' script +creates it from Linux vanilla sources and the kerrighed patch. If +present when running 'configure', this dir will be used as is. + +3.7/ Kernel Options Hints +=========================== + +If you want to edit kernel options, note that the following are +currently *broken* with Kerrighed: + + - Processor type and features -> Preemption Model -> Voluntary + Kernel Preemption (CONFIG_PREEMPT_NONE=y, + CONFIG_PREEMPT_VOLUNTARY=n, CONFIG_PREEMPT=n) + - Exectuble file formats / Emulations -> IA32 Emulation (CONFIG_IA32_EMULATION) + - Security options -> Enable access key retention support (CONFIG_KEYS=n) + +4/ Starting Kerrighed +===================== + +4.1/ New Kerrighed Architecture +=============================== + +Kerrighed is now isolated inside a Linux container on all nodes. For +information about Linux containers, please refer to technical articles +available on the web, for instance from [1]. + +These changes the way userspace has to setup and start a +cluster. + +In a few words, each Kerrighed node starts a 'root' container in which +only local resources are available. To access resources globally, one +must start the Kerrighed container on one node then add other nodes in +the Kerrighed container. + +4.2/ Quick Setup +================ + +As many different use cases are possible with this new architecture, +we define the default one as: + +- the root container and the Kerrighed container are running on the + same filesystem, + +- the root container runs a complete distribution, + +- the Kerrighed container runs sshd on a non-standard port (2222) to + allow user login. + + Note: for root container sshd on port 2222 and Kerrighed container + sshd on (standard) port 22, edit respectively files `/etc/default/ssh' + and `/etc/kerrighed/krginit_helper.conf'. + +- we know the number of nodes we want to start on boot and their + respective node_id. + +Now, we suppose you followed instructions in section 2 'Quick +Installation'. + +- Edit `/etc/default/kerrighed-host'. + Set BOOT_ID to the node_id of the node starting the container. + +- Edit `/etc/default/kerrighed'. + Set ADD_OPTS to "--total N" where N is the number of nodes you want + in the cluster at boot time. You will be able to add other nodes + later if you want with the krgadm(1) tool. + +- Add `kerrighed-host' init script to your default runlevel. + On Debian system, this can be done with: + + % update-rc.d kerrighed-host defaults 99 + +4.3/ Kernel Configuration +========================= + +The Kerrighed kernel is configured through kernel boot parameters. + +- session_id=X + + The session_id contains identifier of the cluster. When several + Kerrighed clusters have to share the same ethernet switch, each + cluster should define a different session identifier to avoid + collisions. + + A session identifier is a simple integer. Valid range is + 1..9999. + + This parameter is mandatory. + +- node_id=X + + The node_id contains identifier of the node. It is an integer. It + must be unique over the Kerrighed cluster. Valid range is 0..255. + + Unless autonodeid is activated, this parameter is mandatory. + +- autonodeid=0|1 + + When autonodeid value is 1, node_id is the last digit of the IP + address. This requires the NIC driver to be compiled into the kernel + and IP address to be set really early, either by DHCP or as kernel + boot parameters (see bootparam(7)). + + Default is 1 (activated). + +[1] http://lxc.sf.net commit 5dbf3667b7f3a4b88f726e777801468bb148d73f Author: Jean Parpaillon <jea...@ke...> Date: Wed May 5 17:24:10 2010 +0200 [man] Remove kerrighed_nodes file mentions diff --git a/man/Makefile.am b/man/Makefile.am index 4447afa..36de3b1 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -9,7 +9,6 @@ man_MANS = \ krgadm.1 \ kerrighed.7 \ - kerrighed_nodes.5 \ kerrighed_capabilities.7 \ krgcapset.1 \ krgcapset.2 \ diff --git a/man/kerrighed.7.xml b/man/kerrighed.7.xml index 87db893..66deb40 100644 --- a/man/kerrighed.7.xml +++ b/man/kerrighed.7.xml @@ -95,9 +95,7 @@ <refsect1> <title>Configuration</title> <para> - Kerrighed kernel can be setup - with <filename>/etc/kerrighed_nodes</filename>(5) or with kernel - boot parameters. + Kerrighed kernel is setup through boot parameters. </para> <refsect2> @@ -116,9 +114,7 @@ Valid range is 1..9999. </para> <para> - This parameter is mandatory, unless specified - through <filename>/etc/kerrighed_nodes</filename>(5). There - is no default. + This parameter is mandatory. </para> </listitem> </varlistentry> @@ -132,9 +128,8 @@ Valid range is 0..255. </para> <para> - Unless <varname>autonodeid</varname> is activated or - <filename>/etc/kerrighed_nodes</filename>(5) file is complete, - this parameter is mandatory. + Unless <varname>autonodeid</varname> is activated this + parameter is mandatory. </para> </listitem> </varlistentry> @@ -154,21 +149,6 @@ </para> </listitem> </varlistentry> - <varlistentry> - <term>nb_nodes_min=N</term> - <listitem> - <para> - The <varname>nb_nodes_min</varname> controls the - autostart feature of Kerrighed. If set to an integer, - kernel waits for this amount of nodes to be present - before starting Kerrighed cluster. - </para> - <para> - If not specified, Kerrighed cluster is not started - automatically. - </para> - </listitem> - </varlistentry> </variablelist> </para> </refsect2> @@ -187,7 +167,6 @@ <refsect1> <title>See also</title> <para> - <ulink url="kerrighed_nodes.5.html" ><command>kerrighed_nodes</command> (5)</ulink>, <ulink url="kerrighed_capabilities.7.html" ><command>kerrighed_capabilities</command> (7)</ulink>, <ulink url="migrate.1.html" ><command>migrate</command> (1)</ulink>, <ulink url="krgcapset.1.html" ><command>krgcapset</command> (1)</ulink>, diff --git a/man/kerrighed_capabilities.7.xml b/man/kerrighed_capabilities.7.xml index 8f5d3dc..e4de5d6 100644 --- a/man/kerrighed_capabilities.7.xml +++ b/man/kerrighed_capabilities.7.xml @@ -143,23 +143,6 @@ </refsect2> </refsect1> - - <refsect1> - <title>Files</title> - <para> - <variablelist> - <varlistentry> - <term><filename>/etc/kerrighed_nodes</filename></term> - <listitem> - <para> - This file contains the list of nodes used in the Kerrighed cluster. See - <command>kerrighed_nodes</command>(5) for further details. - </para> - </listitem> - </varlistentry> - </variablelist> - </para> - </refsect1> <refsect1> <title>Author</title> diff --git a/man/kerrighed_nodes.5.xml b/man/kerrighed_nodes.5.xml deleted file mode 100644 index 4d8943d..0000000 --- a/man/kerrighed_nodes.5.xml +++ /dev/null @@ -1,85 +0,0 @@ -<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" -"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> - -<refentry id='kerrighed_nodes.5'> - <refmeta> - <refentrytitle>kerrighed_nodes</refentrytitle> - <manvolnum>5</manvolnum> - </refmeta> - - <refnamediv> - <refname>kerrighed_nodes </refname> - <refpurpose>File hosting nodes list and session number of a Kerrighed cluster.</refpurpose> - </refnamediv> - - - <refsect1> - <title>Description</title> - <para> - The <filename>/etc/kerrighed_nodes</filename> file contains the list of nodes belonging - to the Kerrighed cluster. Each node name is on a separate line and is followed by - the logical node number and the name of the network device to - use for Kerrighed communications. - </para> - <para> - The <varname>session</varname> field contains identifier of the - cluster. When several Kerrighed clusters have to share the same - Ethernet switch, each cluster should define a different session - identifier to avoid collisions. A session identifier is a simple - integer. - </para> - <para> - The <varname>nbmin</varname> field is used to define the number - of nodes to be automatically started when a Kerrighed cluster is - booting. This field is optional. When this field is set, the use - of the <command>krgadm</command> is not needed any more. During - the boot phase of cluster nodes when the kerrighed module is - loaded, Kerrighed waits for "nbmin" nodes to be up. Then the - required number of nodes are up, Kerrighed is automatically - started. - </para> - <para> - </para> - <example> - <title><filename>kerrighed_nodes</filename></title> - <programlisting> - session=1 - nbmin=4 - node1:0:eth0 - node2:1:eth0 - node3:2:eth0 - node4:3:eth0 - </programlisting> - </example> - </refsect1> - - <refsect1> - <title>Files</title> - <para> - <variablelist> - <varlistentry> - <term><filename>/etc/kerrighed_nodes</filename></term> - <listitem> - <para> - </para> - </listitem> - </varlistentry> - </variablelist> - </para> - </refsect1> - - <refsect1> - <title>Author</title> - <para> - Renaud Lottiaux <email>ren...@ke...</email> - </para> - </refsect1> - - <refsect1> - <title>See Also</title> - <para> - <ulink url="kerrighed_session.5.html" ><command>kerrighed_session</command> (5)</ulink>, - <ulink url="krgadm.1.html" ><command>krgadm</command> (1)</ulink> - </para> - </refsect1> -</refentry> diff --git a/man/migrate.1.xml b/man/migrate.1.xml index 35b4117..ff80878 100644 --- a/man/migrate.1.xml +++ b/man/migrate.1.xml @@ -29,23 +29,6 @@ </refsect1> <refsect1> - <title>Files</title> - <para> - <variablelist> - <varlistentry> - <term><filename>/etc/kerrighed_nodes</filename></term> - <listitem> - <para> - This file contains the list of nodes used in the Kerrighed cluster. - See <command>kerrighed_nodes</command>(5) for further details. - </para> - </listitem> - </varlistentry> - </variablelist> - </para> - </refsect1> - - <refsect1> <title>Author</title> <para> Renaud Lottiaux <email>ren...@ke...</email> diff --git a/man/migrate.2.xml b/man/migrate.2.xml index 47eefe2..768f809 100644 --- a/man/migrate.2.xml +++ b/man/migrate.2.xml @@ -63,23 +63,6 @@ </refsect1> <refsect1> - <title>Files</title> - <para> - <variablelist> - <varlistentry> - <term><filename>/etc/kerrighed_nodes</filename></term> - <listitem> - <para> - This file contains the list of nodes used in the Kerrighed cluster. - See <command>kerrighed_nodes</command>(5) for further details. - </para> - </listitem> - </varlistentry> - </variablelist> - </para> - </refsect1> - - <refsect1> <title>Author</title> <para> Renaud Lottiaux <email>ren...@ke...</email> diff --git a/man/migrate_self.2.xml b/man/migrate_self.2.xml index 15fd654..f51298c 100644 --- a/man/migrate_self.2.xml +++ b/man/migrate_self.2.xml @@ -56,23 +56,6 @@ </refsect1> <refsect1> - <title>Files</title> - <para> - <variablelist> - <varlistentry> - <term><filename>/etc/kerrighed_nodes</filename></term> - <listitem> - <para> - This file contains the list of nodes used in the Kerrighed cluster. See - <command>kerrighed_nodes</command>(5) for further details. - </para> - </listitem> - </varlistentry> - </variablelist> - </para> - </refsect1> - - <refsect1> <title>Author</title> <para> Renaud Lottiaux <email>ren...@ke...</email> commit 388d87c8843c052aef2ff7e7ff60481a3bc6966c Author: Jean Parpaillon <jea...@ke...> Date: Wed May 5 12:38:12 2010 +0000 [tools] link tools and tools-host statically with libkerrighed and libkrgcb While libkerrighed API is not stable enough, static linking is more secure. diff --git a/tools-host/Makefile.am b/tools-host/Makefile.am index efccd71..0a138c0 100644 --- a/tools-host/Makefile.am +++ b/tools-host/Makefile.am @@ -11,6 +11,7 @@ sbin_PROGRAMS = krgboot INCLUDES = -I@top_srcdir@/libs/include LDADD = @top_builddir@/libs/libkerrighed/libkerrighed.la @top_builddir@/libs/libkrgcb/libkrgcb.la +AM_LDFLAGS=-Wl,--as-needed -static krgboot_SOURCES = krgboot.c diff --git a/tools/Makefile.am b/tools/Makefile.am index a3d7aad..3bddeb5 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -12,7 +12,7 @@ sbin_PROGRAMS = krgadm krginit INCLUDES = -I@top_srcdir@/libs/include LDADD = @top_builddir@/libs/libkerrighed/libkerrighed.la @top_builddir@/libs/libkrgcb/libkrgcb.la -AM_LDFLAGS = -Wl,--as-needed +AM_LDFLAGS = -Wl,--as-needed -static migrate_SOURCES = migrate.c checkpoint_SOURCES = checkpoint.c commit 0c75f669a94afd89a7c2ff258d8c383ae4dc0454 Author: Louis Rilling <lou...@ke...> Date: Thu May 6 17:16:56 2010 +0200 ChangeLog: more updates Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/ChangeLog b/ChangeLog index d61095a..65757dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,22 @@ Checkpoint/restart * Add various options to checkpoint and restart * Add tools ipccheckpoint and ipcrestart to help checkpoint/restart of applications using IPC objects + Kerrighed containerization + * [kernel] Run Kerrighed in a Linux container + * New tools krgboot[_helper] and krginit[_helper] to run Kerrighed in a Linux container + * Fully automatic cluster boot + Kerrighed hotplug + * [kernel] Experimental support for adding nodes to a live cluster + * New krgadm semantics: + * kill commands 'cluster start' and 'wait_start', + * make command 'nodes add' the default way to build a cluster + + Fixes: + * [kernel] Support migration of X connections + * [kernel] Many bugfixes in socket migration + * [kernel] Support migration / remote fork of chrooted applications + * [kernel] Many migration fixes + * Remove limitation on number of concurrent executions in KTP Kerrighed version 2.4.4 Features: commit b218993dd55d0b67678cba58980f0b056a758e2b Author: Louis Rilling <lou...@ke...> Date: Thu May 6 17:15:17 2010 +0200 ChangeLog: Remove duplicate entries Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/ChangeLog b/ChangeLog index aa677f1..d61095a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,11 +1,4 @@ Features: - * Remote vfork() - * New RPC transmission engine that highly increases performance - Build system - * Remove sub-configures - * Split tools dir into scripts/ man/ and tools/ - * Create patched kernel source dir in kernel/, no need for --with-kernel option - * Check architecture compatibility Checkpoint/restart * Add various options to checkpoint and restart * Add tools ipccheckpoint and ipcrestart to help checkpoint/restart of applications using IPC objects commit 8937cd62a5ce170f3fade59ab95b3533228015ff Author: Matthieu Fertré <mat...@ke...> Date: Thu May 6 16:22:03 2010 +0200 Changelog: add missing part of changelog coming from kerrighed svn trunk diff --git a/ChangeLog b/ChangeLog index 5f2eb9e..aa677f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,13 +10,62 @@ * Add various options to checkpoint and restart * Add tools ipccheckpoint and ipcrestart to help checkpoint/restart of applications using IPC objects -Kerrighed version 2.3.1 +Kerrighed version 2.4.4 + Features: + * Port driver for Realtek R8169 (present on some Atom platforms) + * Update tg3 driver from Broadcom website. Add support for BCM5784 for instance + * Upgrade krgadm + Fixes: + * Check for admin right for cluster start/shutdown/restart + +Kerrighed version 2.4.2 + Fixes: + * Fix crashes when doing CTRL-C on a process doing memory injection. + * Fix some random memory incoherence in process distant fork. + * Fix OOM in injection mechanism on large memory systems. + * Avoid migration of pages from processes without USE_REMOTE_MEMORY. + * Fix some crashes during distant fork or migration on loaded memory system. + +Kerrighed version 2.4.1 Fixes: + * Major performance improvement + * Fix crashes during migration or distant fork using Lustre. + * Fix crashes with distributed system V memory segments. + * Fix dead-lock in the MM sub-system + * Fix issues in system V message queue identifiers + * Fix deadlock on 32bit platforms in the RPC layer + * Fix forgotten processes in /proc/<pid> directories + * Fix OOM issue using injection mechanism + * Fix memory allocation failure when big buffers are passed to read or write + * Various memory leak fixes. + * Various fixes in the checkpoint/restart sub-system + * Various other fixes. + +Kerrighed version 2.4.0 + Features: + * Remote memory injection + * Configuration scheduler + * Application check-pointing + * Remote vfork() + * New RPC transmission engine that highly increases performance + + Fixes: + * Fix random seg-fault during process migration on 64bits machines. * Fix incompatibilities with IPv6 tunnels and other special net devices * Various bugfixes in RPCs + * Fix a strong memory leak * Fix wrong attempts to migrate threads when this is not supported * Fix random userspace memory access when using fcntl on files remotely open + * Fix random userspace memory access when using ioctl on files remotely open * Fix BUG when the parent of an exiting multi-threaded process is/was remote + * Fix many socket related bugs in the context of migrated processes + * Fix many bugs in krgadm (seg-fault, etc) + + Build system: + * Remove sub-configures + * Split tools dir into scripts/ man/ and tools/ + * Create patched kernel source dir in kernel/, no need for --with-kernel option + * Check architecture compatibility Kerrighed version 2.3.0 Fixes: commit c66a74d81462ab502cc62f78fa2057a7a64f70cf Author: Matthieu Fertré <mat...@ke...> Date: Thu May 6 15:50:06 2010 +0200 Changelog: add information about checkpoint/restart diff --git a/ChangeLog b/ChangeLog index 7cf797c..5f2eb9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,9 @@ * Split tools dir into scripts/ man/ and tools/ * Create patched kernel source dir in kernel/, no need for --with-kernel option * Check architecture compatibility + Checkpoint/restart + * Add various options to checkpoint and restart + * Add tools ipccheckpoint and ipcrestart to help checkpoint/restart of applications using IPC objects Kerrighed version 2.3.1 Fixes: commit d27dcb4861c29aef2b1404a28a3de8e1799ced45 Author: Louis Rilling <lou...@ke...> Date: Mon May 3 17:32:24 2010 +0200 capabilities: Constify krg_cap_t *args that can. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/libs/include/capability.h b/libs/include/capability.h index a7dcb54..064a6e0 100644 --- a/libs/include/capability.h +++ b/libs/include/capability.h @@ -9,19 +9,19 @@ #include <sys/types.h> #include "capabilities.h" -int krg_father_capset (krg_cap_t * new_caps) ; +int krg_father_capset (const krg_cap_t * new_caps) ; int krg_father_capget (krg_cap_t * old_caps) ; -int krg_capset (krg_cap_t * new_caps) ; +int krg_capset (const krg_cap_t * new_caps) ; int krg_capget (krg_cap_t * old_caps) ; -int krg_pid_capset (pid_t pid, krg_cap_t * new_caps) ; +int krg_pid_capset (pid_t pid, const krg_cap_t * new_caps) ; int krg_pid_capget (pid_t pid, krg_cap_t * old_caps) ; -i... [truncated message content] |
From: Marko O. <d0...@us...> - 2010-05-10 13:05:26
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "kdfs". The branch, make_kdfs_compile has been updated via 09fd7d0746ec22a4e163188aebb7147fb8c61322 (commit) via b01b17376d12023d0952047841175a68345bfd06 (commit) via b3e158fe025b642dda684d4ef957dfe3f581f776 (commit) via e4a490b0744ad5691961332ebc4cad77ad78482d (commit) via f64308ed8be6fc2bb4e88582f9876b789f4895d8 (commit) via 871bdf0117fbeed9df38c82ea2f77c9481338660 (commit) via 635a1af60d16b456bdae220321ba320eb00f19a8 (commit) via 00e3b3880d1edb227c8153d956b2450272fab5c4 (commit) via fe0ed05df1f7927be0e8ace2ad36e556a06f5313 (commit) via 3b2fab03b702dfb7b678c253f1b2983f94800928 (commit) via 41b81992baafff2f9535058662e218c6a9ee27b5 (commit) via 00074f9148ef9b702ee6567a69c5f2ff46113da5 (commit) via c93a67ac1b8f25bc4e31e148c7e9c918defd4b01 (commit) via 86958eac59fef5207bfe0af8109b9dce1c0aaf78 (commit) via d88cfb7a549d6fdc7d6f6961f526e6f4bca1f718 (commit) via 1b7959fafd64616e96566c8ea0a1c9f1a37ce587 (commit) via 20080753bddca03d80d49a482c33521b4d7d2b80 (commit) via faa3ca19c8b9663ef5813d81d30f6f0faf9508c0 (commit) from 762965ebbe2272674107af959aedba5e62ab1dff (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 09fd7d0746ec22a4e163188aebb7147fb8c61322 Author: Marko Obrovac <mar...@in...> Date: Mon May 10 17:04:02 2010 +0200 Some minor changes: change the debug level and some space corrections diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index 8034466..b7516c8 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -152,8 +152,9 @@ int kdfs_write_begin (struct file *file, from = pos & (PAGE_CACHE_SIZE - 1); page = grab_cache_page_write_begin(mapping, index, flags); - if (!page) - return -ENOMEM; + if (!page) { + return -ENOMEM; + } *pagep = page; /* try to write from the beginning of the page (due to possible page overlap) */ diff --git a/fs/kdfs/debug_kdfs.h b/fs/kdfs/debug_kdfs.h index 9b5ddbc..d3859ca 100644 --- a/fs/kdfs/debug_kdfs.h +++ b/fs/kdfs/debug_kdfs.h @@ -29,7 +29,7 @@ #define DBG_TRACE 3 #define DBG_INFO 4 -#define KDFS_DEBUG_LEVEL 1 +#define KDFS_DEBUG_LEVEL 2 #ifdef DEBUG #undef DEBUG commit b01b17376d12023d0952047841175a68345bfd06 Merge: 762965e b3e158f Author: Marko Obrovac <mar...@in...> Date: Mon May 10 17:00:44 2010 +0200 Merge branch 'master' of git://mirrors.git.kernel.org/cluster/kerrighed/kernel into make_kdfs_compile commit b3e158fe025b642dda684d4ef957dfe3f581f776 Author: Louis Rilling <lou...@ke...> Date: Thu May 6 14:46:28 2010 +0200 [BUGFIX] krgepm: Fix double free on import's copy_process() error Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index c5beee4..17daca8 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -28,9 +28,6 @@ DEFINE_TRACE(power_end); int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) { *dst = *src; -#ifdef CONFIG_KRG_EPM - if (!krg_current) -#endif if (src->thread.xstate) { dst->thread.xstate = kmem_cache_alloc(task_xstate_cachep, GFP_KERNEL); diff --git a/arch/x86/kerrighed/ghost.c b/arch/x86/kerrighed/ghost.c index bcaba91..880711f 100644 --- a/arch/x86/kerrighed/ghost.c +++ b/arch/x86/kerrighed/ghost.c @@ -90,7 +90,7 @@ void unimport_thread_info(struct task_struct *task) void free_ghost_thread_info(struct task_struct *ghost) { - __free_thread_info(ghost->stack); + free_thread_info(ghost->stack); } int export_thread_struct(struct epm_action *action, commit e4a490b0744ad5691961332ebc4cad77ad78482d Author: Louis Rilling <lou...@ke...> Date: Tue May 4 18:00:58 2010 +0200 krghotplug: Try to make add verbosity understandable Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/kerrighed/hotplug/add.c b/kerrighed/hotplug/add.c index 85ef64f..0a3a41a 100644 --- a/kerrighed/hotplug/add.c +++ b/kerrighed/hotplug/add.c @@ -39,7 +39,7 @@ static void handle_node_add(struct rpc_desc *rpc_desc, void *data, size_t size) ctx = hotplug_ctx_alloc(ns); put_krg_ns(ns); if (!ctx) { - printk("kerrighed: Failed to add nodes!\n"); + printk("kerrighed: [ADD] Failed to add nodes!\n"); return; } ctx->node_set = *(struct hotplug_node_set *)data; @@ -72,7 +72,7 @@ static int do_nodes_add(struct hotplug_context *ctx) ret = krgnodelist_scnprintf(page, PAGE_SIZE, ctx->node_set.v); BUG_ON(ret >= PAGE_SIZE); - printk("kerrighed: Adding nodes %s ...\n", page); + printk("kerrighed: [ADD] Adding nodes %s ...\n", page); free_page((unsigned long)page); @@ -83,7 +83,7 @@ static int do_nodes_add(struct hotplug_context *ctx) */ ret = do_cluster_start(ctx); if (ret) { - printk(KERN_ERR "kerrighed: Adding nodes failed! err=%d\n", + printk(KERN_ERR "kerrighed: [ADD] Adding nodes failed! err=%d\n", ret); return ret; } @@ -92,7 +92,7 @@ static int do_nodes_add(struct hotplug_context *ctx) for_each_online_krgnode(node) rpc_async(NODE_ADD, node, &ctx->node_set, sizeof(ctx->node_set)); - printk("kerrighed: Adding nodes succeeded.\n"); + printk("kerrighed: [ADD] Adding nodes succeeded.\n"); return ret; } diff --git a/kerrighed/hotplug/cluster.c b/kerrighed/hotplug/cluster.c index 8925562..768f25d 100644 --- a/kerrighed/hotplug/cluster.c +++ b/kerrighed/hotplug/cluster.c @@ -617,7 +617,7 @@ static void cluster_start_worker(struct work_struct *work) ret = krgnodelist_scnprintf(page, PAGE_SIZE, cluster_start_ctx->node_set.v); BUG_ON(ret >= PAGE_SIZE); - printk("kerrighed: Cluster start on nodes %s ...\n", page); + printk("kerrighed: [ADD] Setting up new nodes %s ...\n", page); free_page((unsigned long)page); @@ -645,10 +645,10 @@ end: rpc_end(desc, 0); out: if (err) - printk(KERN_ERR "kerrighed: Cluster start failed! err=%d\n", + printk(KERN_ERR "kerrighed: [ADD] Setting up new nodes failed! err=%d\n", err); else - printk("kerrighed: Cluster start succeeded.\n"); + printk("kerrighed: [ADD] Setting up new nodes succeeded.\n"); spin_lock(&cluster_start_lock); hotplug_ctx_put(cluster_start_ctx); cluster_start_ctx = NULL; @@ -671,8 +671,8 @@ int do_cluster_start(struct hotplug_context *ctx) if (!cluster_start_ctx) { r = -EPERM; if (cluster_start_msg.seq_id == ULONG_MAX) { - printk(KERN_WARNING "kerrighed: " - "Max number of cluster start attempts " + printk(KERN_WARNING "kerrighed: [ADD] " + "Max number of add attempts " "reached! You should reboot host.\n"); } else { r = 0; commit f64308ed8be6fc2bb4e88582f9876b789f4895d8 Author: Louis Rilling <lou...@ke...> Date: Mon May 3 18:46:07 2010 +0200 krghotplug: Kill cluster_start() and krg_cluster_autostart() Cluster start should no longer be a user-visible action, and is done by node_ready(), so kill syscalls cluster_start() and related. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/include/kerrighed/krg_services.h b/include/kerrighed/krg_services.h index b50a4a9..a601c8d 100644 --- a/include/kerrighed/krg_services.h +++ b/include/kerrighed/krg_services.h @@ -69,9 +69,9 @@ #define KSYS_GET_NODES_COUNT _IOR(KERRIGHED_PROC_MAGIC, \ COMM_PROC_BASE + 1, \ int) -#define KSYS_HOTPLUG_START _IOW(KERRIGHED_PROC_MAGIC, \ - COMM_PROC_BASE + 3, \ - __krgnodemask_t) +/* Removed: #define KSYS_HOTPLUG_START _IOW(KERRIGHED_PROC_MAGIC, \ */ +/* COMM_PROC_BASE + 3, \ */ +/* __krgnodemask_t) */ #define KSYS_HOTPLUG_RESTART _IOW(KERRIGHED_PROC_MAGIC, \ COMM_PROC_BASE + 4, \ __krgnodemask_t) @@ -99,8 +99,8 @@ #define KSYS_HOTPLUG_POWEROFF _IOW(KERRIGHED_PROC_MAGIC, \ COMM_PROC_BASE + 12, \ struct __hotplug_node_set) -#define KSYS_HOTPLUG_WAIT_FOR_START _IO(KERRIGHED_PROC_MAGIC, \ - COMM_PROC_BASE + 13) +/* Removed: #define KSYS_HOTPLUG_WAIT_FOR_START _IO(KERRIGHED_PROC_MAGIC, \ */ +/* COMM_PROC_BASE + 13) */ #define KSYS_HOTPLUG_SET_CREATOR _IO(KERRIGHED_PROC_MAGIC, \ COMM_PROC_BASE + 14) #define KSYS_HOTPLUG_READY _IO(KERRIGHED_PROC_MAGIC, \ diff --git a/kerrighed/hotplug/cluster.c b/kerrighed/hotplug/cluster.c index c681b30..8925562 100644 --- a/kerrighed/hotplug/cluster.c +++ b/kerrighed/hotplug/cluster.c @@ -58,11 +58,6 @@ enum { static char clusters_status[KERRIGHED_MAX_CLUSTERS]; -static struct hotplug_context __cluster_autostart_ctx = { - .kref = { ATOMIC_INIT(1) }, -}; -static struct hotplug_context *cluster_autostart_ctx; - static struct hotplug_context *cluster_start_ctx; static struct cluster_start_msg { struct hotplug_node_set node_set; @@ -700,95 +695,6 @@ static void do_cluster_wait_for_start(void) wait_for_completion(&cluster_started); } -static int cluster_start(void *arg) -{ - int r = 0; - struct __hotplug_node_set __node_set; - struct hotplug_context *ctx; - - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - - if (copy_from_user(&__node_set, arg, sizeof(__node_set))) - return -EFAULT; - - if (!current->nsproxy->krg_ns) - return -EPERM; - - ctx = hotplug_ctx_alloc(current->nsproxy->krg_ns); - ctx->node_set.subclusterid = __node_set.subclusterid; - r = krgnodemask_copy_from_user(&ctx->node_set.v, &__node_set.v); - if (r) - goto out; - - r = do_cluster_start(ctx); - if (!r) - do_cluster_wait_for_start(); - -out: - hotplug_ctx_put(ctx); - return r; -} - -void krg_cluster_autostart(void) -{ - struct krg_namespace *ns; - static int already_start = 0; - int i, nb; - - if (likely(already_start) - || kerrighed_nb_nodes_min < 0) - return; - - ns = find_get_krg_ns(); - if (!ns) - return; - - spin_lock(&cluster_start_lock); - if (cluster_autostart_ctx) { - spin_unlock(&cluster_start_lock); - goto out; - } - cluster_autostart_ctx = &__cluster_autostart_ctx; - spin_unlock(&cluster_start_lock); - - cluster_autostart_ctx->ns = ns; - cluster_autostart_ctx->node_set.subclusterid = 0; - nb = 0; - - krgnodes_clear(cluster_autostart_ctx->node_set.v); - for (i=0; i<KERRIGHED_MAX_NODES; i++) { - if ((universe[i].state == 0 - && i != kerrighed_node_id) - || universe[i].subid != -1) - continue; - - if (i < kerrighed_node_id) - goto abort; - - nb++; - krgnode_set(i, cluster_autostart_ctx->node_set.v); - } - - if (nb >= kerrighed_nb_nodes_min) { - already_start = 1; - do_cluster_start(cluster_autostart_ctx); - } - -abort: - spin_lock(&cluster_start_lock); - cluster_autostart_ctx = NULL; - spin_unlock(&cluster_start_lock); -out: - put_krg_ns(ns); -} - -static int cluster_wait_for_start(void __user *arg) -{ - do_cluster_wait_for_start(); - return 0; -} - static int boot_node_ready(struct krg_namespace *ns) { struct hotplug_context *ctx; @@ -941,11 +847,8 @@ int hotplug_cluster_init(void) } rpc_register_void(CLUSTER_START, handle_cluster_start, 0); - - register_proc_service(KSYS_HOTPLUG_START, cluster_start); + register_proc_service(KSYS_HOTPLUG_READY, node_ready); - register_proc_service(KSYS_HOTPLUG_WAIT_FOR_START, - cluster_wait_for_start); register_proc_service(KSYS_HOTPLUG_SHUTDOWN, cluster_stop); register_proc_service(KSYS_HOTPLUG_RESTART, cluster_restart); register_proc_service(KSYS_HOTPLUG_STATUS, cluster_status); diff --git a/kerrighed/hotplug/node_discovering.c b/kerrighed/hotplug/node_discovering.c index 9340dce..853910f 100644 --- a/kerrighed/hotplug/node_discovering.c +++ b/kerrighed/hotplug/node_discovering.c @@ -14,7 +14,6 @@ struct universe_elem universe[KERRIGHED_MAX_NODES]; void krg_node_reachable(kerrighed_node_t); void krg_node_unreachable(kerrighed_node_t); -void krg_cluster_autostart(void); void krg_node_arrival(kerrighed_node_t nodeid) { @@ -22,7 +21,6 @@ void krg_node_arrival(kerrighed_node_t nodeid) krg_node_reachable(nodeid); #ifdef CONFIG_KRG_HOTPLUG universe[nodeid].state = 1; - krg_cluster_autostart(); #endif } commit 871bdf0117fbeed9df38c82ea2f77c9481338660 Author: Louis Rilling <lou...@ke...> Date: Mon May 3 18:35:52 2010 +0200 krghotplug: Make node_ready() automatically start the cluster In other words, node_ready() brings the current node to online state, either starting a new cluster or adding it to a running cluster depending on how the Kerrighed container was created. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/kerrighed/hotplug/cluster.c b/kerrighed/hotplug/cluster.c index c46ffac..c681b30 100644 --- a/kerrighed/hotplug/cluster.c +++ b/kerrighed/hotplug/cluster.c @@ -789,13 +789,33 @@ static int cluster_wait_for_start(void __user *arg) return 0; } -static int node_ready(void __user *arg) +static int boot_node_ready(struct krg_namespace *ns) { - struct krg_namespace *ns = current->nsproxy->krg_ns; + struct hotplug_context *ctx; + int r; - if (!ns || ns != cluster_init_helper_ns) + if (!capable(CAP_SYS_ADMIN)) return -EPERM; + ctx = hotplug_ctx_alloc(ns); + if (!ctx) + return -ENOMEM; + ctx->node_set.subclusterid = 0; + ctx->node_set.v = krgnodemask_of_node(kerrighed_node_id); + + r = do_cluster_start(ctx); + hotplug_ctx_put(ctx); + + if (!r) + do_cluster_wait_for_start(); + + return r; +} + +static int other_node_ready(struct krg_namespace *ns) +{ + BUG_ON(ns != cluster_init_helper_ns); + if (krg_container_may_conflict(ns)) return -EBUSY; if (krg_container_cleanup(ns)) @@ -805,6 +825,19 @@ static int node_ready(void __user *arg) return 0; } +static int node_ready(void __user *arg) +{ + struct krg_namespace *ns = current->nsproxy->krg_ns; + + if (!ns) + return -EPERM; + + if (!cluster_init_helper_ns) + return boot_node_ready(ns); + else + return other_node_ready(ns); +} + static int cluster_restart(void *arg) { int unused; commit 635a1af60d16b456bdae220321ba320eb00f19a8 Author: Louis Rilling <lou...@ke...> Date: Thu May 6 10:53:22 2010 +0200 [BUGFIX] krgepm: Disable krg_current before waiting in mempool_alloc() Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/mm/mempool.c b/mm/mempool.c index a46eb1b..709cc37 100644 --- a/mm/mempool.c +++ b/mm/mempool.c @@ -205,6 +205,9 @@ void * mempool_alloc(mempool_t *pool, gfp_t gfp_mask) unsigned long flags; wait_queue_t wait; gfp_t gfp_temp; +#ifdef CONFIG_KRG_EPM + struct task_struct *krg_cur; +#endif might_sleep_if(gfp_mask & __GFP_WAIT); @@ -232,6 +235,10 @@ repeat_alloc: if (!(gfp_mask & __GFP_WAIT)) return NULL; +#ifdef CONFIG_KRG_EPM + krg_cur = krg_current; + krg_current = NULL; +#endif /* Now start performing page reclaim */ gfp_temp = gfp_mask; init_wait(&wait); @@ -245,6 +252,9 @@ repeat_alloc: io_schedule_timeout(5*HZ); } finish_wait(&pool->wait, &wait); +#ifdef CONFIG_KRG_EPM + krg_current = krg_cur; +#endif goto repeat_alloc; } commit 00e3b3880d1edb227c8153d956b2450272fab5c4 Author: Louis Rilling <lou...@ke...> Date: Thu Feb 18 17:52:03 2010 +0100 krgipc: Remove unused label Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/ipc/semarray_io_linker.c b/ipc/semarray_io_linker.c index cba842f..9704716 100644 --- a/ipc/semarray_io_linker.c +++ b/ipc/semarray_io_linker.c @@ -228,7 +228,6 @@ int semarray_insert_object (struct kddm_obj * obj_entry, update_local_sem(sem_object->local_sem, &sem_object->imported_sem); -exit: return r; } commit fe0ed05df1f7927be0e8ace2ad36e556a06f5313 Author: Louis Rilling <lou...@ke...> Date: Thu May 6 17:26:04 2010 +0200 Fix warning about goto label defined but not used diff --git a/ipc/msg_io_linker.c b/ipc/msg_io_linker.c index de23a3f..6018149 100644 --- a/ipc/msg_io_linker.c +++ b/ipc/msg_io_linker.c @@ -194,7 +194,6 @@ int msq_insert_object (struct kddm_obj * obj_entry, put_ipc_ns(ns); } -exit: return r; } commit 3b2fab03b702dfb7b678c253f1b2983f94800928 Author: Louis Rilling <lou...@ke...> Date: Tue May 4 17:40:31 2010 +0200 krghotplug: Improve message on container init exec failure Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/kerrighed/hotplug/cluster.c b/kerrighed/hotplug/cluster.c index f88c840..c46ffac 100644 --- a/kerrighed/hotplug/cluster.c +++ b/kerrighed/hotplug/cluster.c @@ -441,8 +441,8 @@ static int krg_container_init(void *arg) cluster_init_helper_envp); BUG_ON(!err); printk(KERN_ERR - "kerrighed: Kerrighed container userspace init failed: err=%d\n", - err); + "kerrighed: Could not execute container init '%s': err=%d\n", + cluster_init_helper_path, err); krg_container_abort(err); commit 41b81992baafff2f9535058662e218c6a9ee27b5 Author: Louis Rilling <lou...@ke...> Date: Tue May 4 15:56:22 2010 +0200 [BUGFIX] migration: Fix remote tasks entries displayed with SEE_LOCAL_PROC_STAT Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/kerrighed/procfs/proc_pid.c b/kerrighed/procfs/proc_pid.c index 38ba1a2..7591442 100644 --- a/kerrighed/procfs/proc_pid.c +++ b/kerrighed/procfs/proc_pid.c @@ -585,6 +585,10 @@ static int krg_proc_pid_fill_cache(struct file *filp, krg_task_unlock(iter.tgid); return retval; } +#if defined(CONFIG_KRG_EPM) && defined(CONFIG_KRG_CAP) + if (can_use_krg_cap(current, CAP_SEE_LOCAL_PROC_STAT)) + return retval; +#endif if (obj) { proc_task.task_obj = obj; commit 00074f9148ef9b702ee6567a69c5f2ff46113da5 Author: Louis Rilling <lou...@ke...> Date: Tue May 4 15:54:39 2010 +0200 [BUGFIX] migration: Fix procfs crash Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/kerrighed/procfs/proc_pid.c b/kerrighed/procfs/proc_pid.c index 15665a0..38ba1a2 100644 --- a/kerrighed/procfs/proc_pid.c +++ b/kerrighed/procfs/proc_pid.c @@ -575,8 +575,11 @@ static int krg_proc_pid_fill_cache(struct file *filp, obj = krg_task_readlock(iter.tgid); if (iter.task - && ((!obj && iter.task->exit_state != EXIT_MIGRATION) - || obj->task == iter.task)) { +#ifdef CONFIG_KRG_EPM + && ((!obj && iter.task->real_parent != baby_sitter) + || (obj && obj->task == iter.task)) +#endif + ) { /* Task is local and not a remaining part of a migrated task. */ retval = proc_pid_fill_cache(filp, dirent, filldir, iter); krg_task_unlock(iter.tgid); commit c93a67ac1b8f25bc4e31e148c7e9c918defd4b01 Author: Matthieu Fertré <mat...@ke...> Date: Mon Apr 26 15:28:44 2010 +0200 Checkpoint: print the filename in error diff --git a/include/kerrighed/file_stat.h b/include/kerrighed/file_stat.h index c1883d8..f8fb509 100644 --- a/include/kerrighed/file_stat.h +++ b/include/kerrighed/file_stat.h @@ -46,6 +46,10 @@ char *get_phys_filename(struct file *file, char *buffer, bool del_ok); */ char *get_filename(struct file *file, char *buffer); +char *alloc_filename(struct file *file, char **buffer); + +void free_filename(char *buffer); + int can_checkpoint_file(const struct file *file); #endif diff --git a/kerrighed/fs/file_stat.c b/kerrighed/fs/file_stat.c index cdbf147..e98d3eb 100644 --- a/kerrighed/fs/file_stat.c +++ b/kerrighed/fs/file_stat.c @@ -147,6 +147,31 @@ char *get_filename(struct file *file, char *buffer) return get_phys_filename(file, buffer, true); } +char *alloc_filename(struct file *file, char **buffer) +{ + char *file_name; + + *buffer = (char *)__get_free_page(GFP_KERNEL); + if (!*buffer) { + file_name = ERR_PTR(-ENOMEM); + goto exit; + } + + file_name = get_filename(file, *buffer); + if (!file_name) { + file_name = *buffer; + sprintf(file_name, "?"); + } + +exit: + return file_name; +} + +void free_filename(char *buffer) +{ + free_page((unsigned long)buffer); +} + int can_checkpoint_file(const struct file *file) { if (is_socket(file)) { diff --git a/kerrighed/fs/regular_file_mgr.c b/kerrighed/fs/regular_file_mgr.c index 601f21a..86800c0 100644 --- a/kerrighed/fs/regular_file_mgr.c +++ b/kerrighed/fs/regular_file_mgr.c @@ -564,11 +564,24 @@ static int cr_export_now_file(struct epm_action *action, ghost_t *ghost, args->file_args.file); error: - if (r) - ckpt_err(action, r, - "Fail to save file %d of process %d (%s)", - args->file_args.index, - task_pid_knr(task), task->comm); + if (r) { + char *buffer, *filename; + filename = alloc_filename(args->file_args.file, &buffer); + if (!IS_ERR(filename)) { + ckpt_err(action, r, + "Fail to save information needed to reopen " + "file %s as fd %d of process %d (%s)", + filename, args->file_args.index, + task_pid_knr(task), task->comm); + free_filename(buffer); + } else { + ckpt_err(action, r, + "Fail to save information needed to reopen " + "fd %d of process %d (%s)", + args->file_args.index, + task_pid_knr(task), task->comm); + } + } return r; } @@ -589,19 +602,12 @@ int cr_export_user_info_file(struct epm_action *action, ghost_t *ghost, file = export->args.file_args.file; - tmp = (char *) __get_free_page (GFP_KERNEL); - if (!tmp) { - r = -ENOMEM; + file_name = alloc_filename(file, &tmp); + if (IS_ERR(file_name)) { + r = PTR_ERR(file_name); goto exit; } - file_name = get_filename(file, tmp); - - if (!file_name) { - file_name = tmp; - sprintf(file_name, "-"); - } - if (is_socket(file)) r = ghost_printf(ghost, "socket "); @@ -630,7 +636,7 @@ int cr_export_user_info_file(struct epm_action *action, ghost_t *ghost, r = ghost_printf(ghost, "file "); if (r) - goto err_free_page; + goto err_free_filename; if (file->f_objid) /* if the file is shared, there is no host node */ @@ -648,7 +654,7 @@ int cr_export_user_info_file(struct epm_action *action, ghost_t *ghost, nodelen, file_node, keylen, key, file_name, task_pid_knr(task), index); if (r) - goto err_free_page; + goto err_free_filename; list_for_each_entry(_export, &export->next, next) { task = _export->task; @@ -657,13 +663,13 @@ int cr_export_user_info_file(struct epm_action *action, ghost_t *ghost, r = ghost_printf(ghost, ",%d:%d", task_pid_knr(task), index); if (r) - goto err_free_page; + goto err_free_filename; } r = ghost_printf(ghost, "\n"); -err_free_page: - free_page ((unsigned long) tmp); +err_free_filename: + free_filename(tmp); exit: return r; } commit 86958eac59fef5207bfe0af8109b9dce1c0aaf78 Author: Matthieu Fertré <mat...@ke...> Date: Mon Apr 26 09:29:22 2010 +0200 Checkpoint: print the task name (when possible) in case of error. diff --git a/ipc/krgipc_mobility.c b/ipc/krgipc_mobility.c index bd9304a..01bb5c1 100644 --- a/ipc/krgipc_mobility.c +++ b/ipc/krgipc_mobility.c @@ -509,8 +509,8 @@ static int cr_export_now_sysv_sem(struct epm_action *action, ghost_t *ghost, err: if (r) ckpt_err(action, r, - "Fail to save semundos of process %d", - task_pid_knr(task)); + "Fail to save semundos of process %d (%s)", + task_pid_knr(task), task->comm); return r; } diff --git a/kerrighed/epm/application/app_checkpoint.c b/kerrighed/epm/application/app_checkpoint.c index 7ae6eb4..946150f 100644 --- a/kerrighed/epm/application/app_checkpoint.c +++ b/kerrighed/epm/application/app_checkpoint.c @@ -258,10 +258,10 @@ static inline void __chkpt_task_req(struct app_struct *app, task_state_t *tsk) r = PTR_ERR(ghost); ckpt_err(NULL, r, "Fail to create file /var/chkpt/%ld/v%d/task_%d.bin " - "to checkpoint process %d", + "to checkpoint process %d (%s)", app->app_id, app->chkpt_sn, task_pid_knr(task), - task_pid_knr(task)); + task_pid_knr(task), task->comm); __set_task_result(task, r); return; } diff --git a/kerrighed/epm/checkpoint.c b/kerrighed/epm/checkpoint.c index b31b87f..2be523c 100644 --- a/kerrighed/epm/checkpoint.c +++ b/kerrighed/epm/checkpoint.c @@ -164,8 +164,9 @@ static int checkpoint_task(struct epm_action *action, if (r) ckpt_err(action, r, - "Fail to checkpoint process %d", - task_pid_knr(task_to_checkpoint)); + "Fail to checkpoint process %d (%s)", + task_pid_knr(task_to_checkpoint), + task_to_checkpoint->comm); out: return r; } diff --git a/kerrighed/epm/sighand.c b/kerrighed/epm/sighand.c index 75a36a0..d27c28a 100644 --- a/kerrighed/epm/sighand.c +++ b/kerrighed/epm/sighand.c @@ -551,8 +551,9 @@ static int cr_export_now_sighand_struct(struct epm_action *action, r = export_sighand_struct(action, ghost, task); if (r) ckpt_err(action, r, - "Fail to save struct sighand_struct of process %d", - task_pid_knr(task)); + "Fail to save struct sighand_struct " + "of process %d (%s)", + task_pid_knr(task), task->comm); return r; } diff --git a/kerrighed/epm/signal.c b/kerrighed/epm/signal.c index 7686e88..50115ff 100644 --- a/kerrighed/epm/signal.c +++ b/kerrighed/epm/signal.c @@ -1044,8 +1044,8 @@ static int cr_export_now_signal_struct(struct epm_action *action, r = export_signal_struct(action, ghost, task); if (r) ckpt_err(action, r, - "Fail to save struct signal_struct of process %d", - task_pid_knr(task)); + "Fail to save struct signal_struct of process %d (%s)", + task_pid_knr(task), task->comm); return r; } diff --git a/kerrighed/fs/mobility.c b/kerrighed/fs/mobility.c index a2c84c1..0ab37e8 100644 --- a/kerrighed/fs/mobility.c +++ b/kerrighed/fs/mobility.c @@ -1493,8 +1493,8 @@ static int cr_export_now_files_struct(struct epm_action *action, ghost_t *ghost, r = export_files_struct(action, ghost, task); if (r) ckpt_err(action, r, - "Fail to save struct files_struct of process %d", - task_pid_knr(task)); + "Fail to save struct files_struct of process %d (%s)", + task_pid_knr(task), task->comm); return r; } @@ -1556,8 +1556,8 @@ static int cr_export_now_fs_struct(struct epm_action *action, ghost_t *ghost, r = export_fs_struct(action, ghost, task); if (r) ckpt_err(action, r, - "Fail to save struct fs_struct of process %d", - task_pid_knr(task)); + "Fail to save struct fs_struct of process %d (%s)", + task_pid_knr(task), task->comm); return r; } diff --git a/kerrighed/fs/regular_file_mgr.c b/kerrighed/fs/regular_file_mgr.c index c99ef52..601f21a 100644 --- a/kerrighed/fs/regular_file_mgr.c +++ b/kerrighed/fs/regular_file_mgr.c @@ -566,9 +566,9 @@ static int cr_export_now_file(struct epm_action *action, ghost_t *ghost, error: if (r) ckpt_err(action, r, - "Fail to save file %d of process %d", + "Fail to save file %d of process %d (%s)", args->file_args.index, - task_pid_knr(task)); + task_pid_knr(task), task->comm); return r; } diff --git a/kerrighed/mm/mobility.c b/kerrighed/mm/mobility.c index 20112e3..2e5ad87 100644 --- a/kerrighed/mm/mobility.c +++ b/kerrighed/mm/mobility.c @@ -1328,8 +1328,8 @@ static int cr_export_now_mm_struct(struct epm_action *action, ghost_t *ghost, r = export_mm_struct(action, ghost, task); if (r) ckpt_err(action, r, - "Fail to save struct mm_struct of process %d", - task_pid_knr(task)); + "Fail to save struct mm_struct of process %d (%s)", + task_pid_knr(task), task->comm); return r; } commit d88cfb7a549d6fdc7d6f6961f526e6f4bca1f718 Author: Matthieu Fertré <mat...@ke...> Date: Thu Apr 29 10:17:08 2010 +0200 [BUGFIX] Fix FAF write() handling with packet size > PAGE_SIZE Code was wrong if the total size of the data to write was greater than PAGE_SIZE. (It was already wrong before patch to support pwrite()). In addition, the error code path was wrong if copy_from_user() fails on the original node. This patch fixes both issues. diff --git a/kerrighed/fs/faf/faf_hooks.c b/kerrighed/fs/faf/faf_hooks.c index 839c33b..833a378 100644 --- a/kerrighed/fs/faf/faf_hooks.c +++ b/kerrighed/fs/faf/faf_hooks.c @@ -331,10 +331,16 @@ ssize_t krg_faf_write(struct file * file, const char *buf, buf_size = to_send; err = copy_from_user(kbuff, &buf[offset], buf_size); - if (err) { - nr = -EFAULT; + if (err) + buf_size = -EFAULT; + + err = rpc_pack_type(desc, buf_size); + if (err) + goto cancel; + + if (buf_size < 0) /* copy_from_user has failed */ break; - } + err = rpc_pack(desc, 0, kbuff, buf_size); if (err) goto cancel; diff --git a/kerrighed/fs/faf/faf_server.c b/kerrighed/fs/faf/faf_server.c index f8ac68e..05a681e 100644 --- a/kerrighed/fs/faf/faf_server.c +++ b/kerrighed/fs/faf/faf_server.c @@ -294,10 +294,17 @@ void handle_faf_write(struct rpc_desc* desc, void *msgIn, size_t size) file = fget(msg->server_fd); while (to_recv > 0) { - if (to_recv < PAGE_SIZE) - buf_size = to_recv; + err = rpc_unpack_type(desc, buf_size); + if (err) + goto cancel; + + /* copy_from_user has failed on the other side */ + if (buf_size < 0) { + nr_received = buf_size; + break; + } - err = rpc_unpack(desc, 0, buf, to_recv); + err = rpc_unpack(desc, 0, buf, buf_size); if (err) goto cancel; commit 1b7959fafd64616e96566c8ea0a1c9f1a37ce587 Author: Matthieu Fertré <mat...@ke...> Date: Tue Apr 27 16:08:49 2010 +0200 [BUGFIX] ckpt_err() does not evaluate arguments if not in a checkpoint That fixes at least one NULL/bad pointer dereference occuring in import_regular_file_from_krg_desc. diff --git a/include/kerrighed/ghost_helpers.h b/include/kerrighed/ghost_helpers.h index bf2c70c..dd457e8 100644 --- a/include/kerrighed/ghost_helpers.h +++ b/include/kerrighed/ghost_helpers.h @@ -321,10 +321,12 @@ int import_process_set_links(struct epm_action *action, ghost_t *ghost, #endif /* CONFIG_KRG_SCHED */ -void do_ckpt_msg(struct epm_action *action, int err, char *fmt, ...); +void do_ckpt_msg(int err, char *fmt, ...); #define ckpt_err(ctx, err, fmt, args...) do { \ - do_ckpt_msg(ctx, err, "[E @ %s:%d : %d] " fmt, __func__,\ + struct epm_action *_action = ctx; \ + if (!_action || _action->type == EPM_CHECKPOINT) \ + do_ckpt_msg(err, "[E @ %s:%d : %d] " fmt, __func__, \ __LINE__, err, ##args); \ } while (0) diff --git a/kerrighed/epm/application/application.c b/kerrighed/epm/application/application.c index 43552ca..c0d8fba 100644 --- a/kerrighed/epm/application/application.c +++ b/kerrighed/epm/application/application.c @@ -1078,14 +1078,11 @@ exit: return r; } -void do_ckpt_msg(struct epm_action *action, int err, char *fmt, ...) +void do_ckpt_msg(int err, char *fmt, ...) { va_list args; char *buffer; - if (action && action->type != EPM_CHECKPOINT) - return; - va_start(args, fmt); buffer = kvasprintf(GFP_KERNEL, fmt, args); va_end(args); commit 20080753bddca03d80d49a482c33521b4d7d2b80 Author: Matthieu Fertré <mat...@ke...> Date: Tue Apr 27 11:47:50 2010 +0200 krgfaf: Support pread() and pwrite() This is done by moving FAF handling from sys_read/write to vfs_read/write, thus making it available for sys_pread() and sys_pwrite(). In addition, this patch cleans/fixes the error code paths for faf_read/write. diff --git a/fs/read_write.c b/fs/read_write.c index 40ba004..336bc8f 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -315,6 +315,10 @@ ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) if (!(file->f_mode & FMODE_READ)) return -EBADF; +#ifdef CONFIG_KRG_FAF + if (file->f_flags & O_FAF_CLT) + return krg_faf_read(file, buf, count, pos); +#endif if (!file->f_op || (!file->f_op->read && !file->f_op->aio_read)) return -EINVAL; if (unlikely(!access_ok(VERIFY_WRITE, buf, count))) @@ -370,6 +374,10 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_ if (!(file->f_mode & FMODE_WRITE)) return -EBADF; +#ifdef CONFIG_KRG_FAF + if (file->f_flags & O_FAF_CLT) + return krg_faf_write(file, buf, count, pos); +#endif if (!file->f_op || (!file->f_op->write && !file->f_op->aio_write)) return -EINVAL; if (unlikely(!access_ok(VERIFY_READ, buf, count))) @@ -414,17 +422,7 @@ SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count) file = fget_light(fd, &fput_needed); if (file) { -#ifdef CONFIG_KRG_FAF - loff_t pos; - if (file->f_flags & O_FAF_CLT) { - ret = krg_faf_read(file, buf, count); - fput_light(file, fput_needed); - return ret; - } - pos = file_pos_read(file); -#else loff_t pos = file_pos_read(file); -#endif ret = vfs_read(file, buf, count, &pos); file_pos_write(file, pos); fput_light(file, fput_needed); @@ -442,17 +440,7 @@ SYSCALL_DEFINE3(write, unsigned int, fd, const char __user *, buf, file = fget_light(fd, &fput_needed); if (file) { -#ifdef CONFIG_KRG_FAF - loff_t pos; - if (file->f_flags & O_FAF_CLT) { - ret = krg_faf_write(file, buf, count); - fput_light(file, fput_needed); - return ret; - } - pos = file_pos_read(file); -#else loff_t pos = file_pos_read(file); -#endif ret = vfs_write(file, buf, count, &pos); file_pos_write(file, pos); fput_light(file, fput_needed); diff --git a/include/kerrighed/faf.h b/include/kerrighed/faf.h index 6640867..966f5f1 100644 --- a/include/kerrighed/faf.h +++ b/include/kerrighed/faf.h @@ -34,9 +34,9 @@ off_t krg_faf_lseek(struct file *file, off_t offset, long krg_faf_llseek(struct file *file, unsigned long offset_high, unsigned long offset_low, loff_t *result, unsigned int origin); -ssize_t krg_faf_read(struct file *file, char *buf, size_t count); +ssize_t krg_faf_read(struct file *file, char *buf, size_t count, loff_t *pos); ssize_t krg_faf_write(struct file *file, const char *buf, - size_t count); + size_t count, loff_t *pos); ssize_t krg_faf_readv(struct file *file, const struct iovec __user *vec, unsigned long vlen, loff_t *pos); ssize_t krg_faf_writev(struct file *file, const struct iovec __user *vec, diff --git a/kerrighed/fs/faf/faf_hooks.c b/kerrighed/fs/faf/faf_hooks.c index 9cdb365..839c33b 100644 --- a/kerrighed/fs/faf/faf_hooks.c +++ b/kerrighed/fs/faf/faf_hooks.c @@ -196,130 +196,179 @@ long krg_faf_llseek (struct file *file, } /** Kerrighed kernel hook for FAF read function. - * @author Renaud Lottiaux + * @author Renaud Lottiaux, Matthieu Fertré * * @param file File to read from. * @param buf Buffer to store data in. * @param count Number of bytes to read. + * @param pos Offset to read from (updated at the end). */ -ssize_t krg_faf_read (struct file * file, - char *buf, - size_t count) +ssize_t krg_faf_read(struct file * file, char *buf, size_t count, loff_t *pos) { faf_client_data_t *data = file->private_data; struct faf_rw_msg msg; ssize_t nr; - long received = 0; + ssize_t received = 0; + loff_t fpos; char *kbuff; int err; - struct rpc_desc* desc; + struct rpc_desc *desc; - kbuff = kmalloc (PAGE_SIZE, GFP_KERNEL); + kbuff = kmalloc(PAGE_SIZE, GFP_KERNEL); if (!kbuff) return -ENOMEM; msg.server_fd = data->server_fd; msg.count = count; + msg.pos = *pos; + nr = -ENOMEM; desc = rpc_begin(RPC_FAF_READ, data->server_id); + if (!desc) + goto out; /* Send read request */ - rpc_pack_type(desc, msg); + err = rpc_pack_type(desc, msg); + if (err) + goto cancel; - nr = unpack_remote_sleep_res_prepare(desc); - if (nr) - goto err; + err = unpack_remote_sleep_res_prepare(desc); + if (err) + goto cancel; /* Get number of bytes to receive */ err = unpack_remote_sleep_res_type(desc, nr); if (err) - nr = err; + goto cancel; + while (nr > 0) { /* Receive file data */ - rpc_unpack(desc, 0, kbuff, nr); - err = copy_to_user (&buf[received], kbuff, nr); + err = rpc_unpack(desc, 0, kbuff, nr); + if (err) + goto cancel; + err = copy_to_user(&buf[received], kbuff, nr); if (err) { nr = -EFAULT; - goto err; + break; } received += nr; err = unpack_remote_sleep_res_type(desc, nr); if (err) - nr = err; + goto cancel; } - if (nr == 0) + + if (!nr) + /* no error occurs when reading */ nr = received; - /* Else, we received an error */ -err: + + /* Receive the updated offset */ + err = rpc_unpack_type(desc, fpos); + if (err) + goto cancel; + *pos = fpos; + +out_end: rpc_end(desc, 0); - kfree (kbuff); +out: + kfree(kbuff); return nr; + +cancel: + rpc_cancel(desc); + if (err > 0) + err = -EPIPE; + nr = err; + goto out_end; } /** Kerrighed kernel hook for FAF write function. - * @author Renaud Lottiaux + * @author Renaud Lottiaux, Matthieu Fertré * * @param file File to write to. * @param buf Buffer of data to write. * @param count Number of bytes to write. + * @param pos Offset to write from (updated at the end). */ -ssize_t krg_faf_write (struct file * file, - const char *buf, - size_t count) +ssize_t krg_faf_write(struct file * file, const char *buf, + size_t count, loff_t *pos) { faf_client_data_t *data = file->private_data; struct faf_rw_msg msg; - ssize_t buf_size = PAGE_SIZE, r; + ssize_t buf_size = PAGE_SIZE, nr; long offset = 0; long to_send = count; + loff_t fpos; char *kbuff; int err; - struct rpc_desc* desc; + struct rpc_desc *desc; - kbuff = kmalloc (PAGE_SIZE, GFP_KERNEL); + kbuff = kmalloc(PAGE_SIZE, GFP_KERNEL); if (!kbuff) return -ENOMEM; msg.server_fd = data->server_fd; msg.count = count; + msg.pos = *pos; + nr = -ENOMEM; desc = rpc_begin(RPC_FAF_WRITE, data->server_id); + if (!desc) + goto out; /* Send write request */ - rpc_pack_type(desc, msg); + err = rpc_pack_type(desc, msg); + if (err) + goto cancel; - r = unpack_remote_sleep_res_prepare(desc); - if (r) - goto err; + err = unpack_remote_sleep_res_prepare(desc); + if (err) + goto cancel; while (to_send > 0) { if (to_send < PAGE_SIZE) buf_size = to_send; - err = copy_from_user (kbuff, &buf[offset], buf_size); + err = copy_from_user(kbuff, &buf[offset], buf_size); if (err) { - r = -EFAULT; - goto err; + nr = -EFAULT; + break; } - rpc_pack(desc, 0, kbuff, buf_size); + err = rpc_pack(desc, 0, kbuff, buf_size); + if (err) + goto cancel; to_send -= buf_size; offset += buf_size; } - err = unpack_remote_sleep_res_type(desc, r); + + err = unpack_remote_sleep_res_type(desc, nr); if (err) - r = err; - else if (r == -EPIPE) + nr = err; + else if (nr == -EPIPE) send_sig(SIGPIPE, current, 0); -err: + /* Receive the updated offset */ + err = rpc_unpack_type(desc, fpos); + if (err) + goto cancel; + *pos = fpos; + +out_end: rpc_end(desc, 0); - kfree (kbuff); +out: + kfree(kbuff); - return r; + return nr; + +cancel: + rpc_cancel(desc); + if (err > 0) + err = -EPIPE; + nr = err; + goto out_end; } ssize_t krg_faf_readv(struct file *file, const struct iovec __user *vec, diff --git a/kerrighed/fs/faf/faf_server.c b/kerrighed/fs/faf/faf_server.c index ce69ff5..f8ac68e 100644 --- a/kerrighed/fs/faf/faf_server.c +++ b/kerrighed/fs/faf/faf_server.c @@ -173,73 +173,108 @@ restore_context(const struct prev_root *prev_root, const struct cred *old_cred) } /** Handler for reading in a FAF open file. - * @author Renaud Lottiaux + * @author Renaud Lottiaux, Matthieu Fertré * * @param from Node sending the request * @param msgIn Request message */ -void handle_faf_read (struct rpc_desc* desc, - void *msgIn, size_t size) +void handle_faf_read(struct rpc_desc* desc, void *msgIn, size_t size) { struct faf_rw_msg *msg = msgIn; + struct file *file = NULL; char *buf = NULL; long buf_size = PAGE_SIZE; ssize_t to_read, r; + loff_t fpos; + int err; - r = remote_sleep_prepare(desc); - if (r) { + err = remote_sleep_prepare(desc); + if (err) { rpc_cancel(desc); return; } + to_read = msg->count; + fpos = msg->pos; + r = -ENOMEM; - buf = kmalloc (PAGE_SIZE, GFP_KERNEL); - if (buf == NULL) - goto exit; + buf = kmalloc(PAGE_SIZE, GFP_KERNEL); + if (!buf) + goto error; + + file = fget(msg->server_fd); - to_read = msg->count; while (to_read > 0) { if (to_read < PAGE_SIZE) buf_size = to_read; - r = sys_read (msg->server_fd, buf, buf_size); + r = vfs_read(file, buf, buf_size, &fpos); if (r > 0) { - rpc_pack_type(desc, r); - rpc_pack(desc, 0, buf, r); + err = rpc_pack_type(desc, r); + if (err) + goto cancel; + err = rpc_pack(desc, 0, buf, r); + if (err) + goto cancel; } - /* Check if we have reach the end of the file */ + /* + * Check if we have reach the end of the file + * or if there is an error + */ if (r < buf_size) break; + to_read -= r; } - /* Pack the end of transmission mark (0) */ + +error: + /* + * Pack the end of transmission mark (0) + * or the error returned by vfs_read() + */ if (r > 0) r = 0; - /* else, pack the error value */ -exit: - rpc_pack_type(desc, r); + err = rpc_pack_type(desc, r); + if (err) + goto cancel; + + /* send the updated file position */ + err = rpc_pack_type(desc, fpos); + if (err) + goto cancel; + +out: if (buf) - kfree (buf); + kfree(buf); + if (file) + fput(file); remote_sleep_finish(); + return; + +cancel: + rpc_cancel(desc); + goto out; } /** Handler for writing in a FAF open file. - * @author Renaud Lottiaux + * @author Renaud Lottiaux, Matthieu Fertré * * @param from Node sending the request * @param msgIn Request message */ -void handle_faf_write (struct rpc_desc* desc, - void *msgIn, size_t size) +void handle_faf_write(struct rpc_desc* desc, void *msgIn, size_t size) { struct faf_rw_msg *msg = msgIn; + struct file *file = NULL; long to_recv; char *buf = NULL; ssize_t buf_size = PAGE_SIZE; ssize_t r, nr_received = -ENOMEM; + loff_t fpos; + int err; r = remote_sleep_prepare(desc); if (r) { @@ -247,40 +282,58 @@ void handle_faf_write (struct rpc_desc* desc, return; } - buf = kmalloc (PAGE_SIZE, GFP_KERNEL); - if (buf == NULL) - goto err; + to_recv = msg->count; + fpos = msg->pos; + + buf = kmalloc(PAGE_SIZE, GFP_KERNEL); + if (!buf) + goto error; nr_received = 0; - to_recv = msg->count; + + file = fget(msg->server_fd); + while (to_recv > 0) { if (to_recv < PAGE_SIZE) buf_size = to_recv; - if(rpc_unpack(desc, 0, buf, to_recv) == RPC_ECLOSE) { - nr_received = -EPIPE; - goto err; - } - r = sys_write (msg->server_fd, buf, buf_size); + err = rpc_unpack(desc, 0, buf, to_recv); + if (err) + goto cancel; + + r = vfs_write(file, buf, buf_size, &fpos); /* The last write failed. Break the write sequence */ if (r < 0) { nr_received = r; - goto err; + break; } nr_received += r; to_recv -= buf_size; } -err: - rpc_pack_type(desc, nr_received); - if (nr_received < 0) - rpc_cancel(desc); + +error: + err = rpc_pack_type(desc, nr_received); + if (err) + goto cancel; + + /* send the updated file position */ + err = rpc_pack_type(desc, fpos); + if (err) + goto cancel; + +out: if (buf) - kfree (buf); + kfree(buf); + if (file) + fput(file); remote_sleep_finish(); - return; + +cancel: + rpc_cancel(desc); + goto out; } static void handle_faf_readv(struct rpc_desc *desc, void *__msg, size_t size) diff --git a/kerrighed/ghost/file_ghost.c b/kerrighed/ghost/file_ghost.c index b3e643b..2d7c811 100644 --- a/kerrighed/ghost/file_ghost.c +++ b/kerrighed/ghost/file_ghost.c @@ -11,12 +11,10 @@ #include <linux/slab.h> #include <linux/string.h> #include <linux/sched.h> +#include <kerrighed/dvfs.h> #include <kerrighed/ghost.h> #include <kerrighed/file_ghost.h> #include <kerrighed/physical_fs.h> -#ifdef CONFIG_KRG_FAF -#include <kerrighed/faf.h> -#endif /*--------------------------------------------------------------------------* * * @@ -36,9 +34,10 @@ */ int file_ghost_read(ghost_t *ghost, void *buff, size_t length) { - struct file_ghost_data *ghost_data ; + struct file_ghost_data *ghost_data; struct file *file = NULL; - int r = 0 ; + loff_t pos; + int r = 0; BUG_ON(!ghost); BUG_ON(!buff); @@ -48,12 +47,9 @@ int file_ghost_read(ghost_t *ghost, void *buff, size_t length) file = ghost_data->file; BUG_ON(!file); -#ifdef CONFIG_KRG_FAF - if (file->f_flags & O_FAF_CLT) - r = krg_faf_read(file, (char*)buff, length); - else -#endif - r = file->f_op->read(file, (char*)buff, length, &file->f_pos); + pos = file_pos_read(file); + r = vfs_read(file, (char*)buff, length, &pos); + file_pos_write(file, pos); if (r == length) r = 0; @@ -74,9 +70,10 @@ int file_ghost_read(ghost_t *ghost, void *buff, size_t length) */ int file_ghost_write(struct ghost *ghost, const void *buff, size_t length) { - struct file_ghost_data *ghost_data ; + struct file_ghost_data *ghost_data; struct file *file = NULL; - int r = 0 ; + loff_t pos; + int r = 0; BUG_ON(!ghost); BUG_ON(!buff); @@ -87,12 +84,9 @@ int file_ghost_write(struct ghost *ghost, const void *buff, size_t length) file = ghost_data->file; BUG_ON(!file); -#ifdef CONFIG_KRG_FAF - if (file->f_flags & O_FAF_CLT) - r = krg_faf_write(file, (char*)buff, length); - else -#endif - r = file->f_op->write(file, (char*)buff, length, &file->f_pos); + pos = file_pos_read(file); + r = vfs_write(file, (char*)buff, length, &pos); + file_pos_write(file, pos); if (r == length) r = 0; commit faa3ca19c8b9663ef5813d81d30f6f0faf9508c0 Author: Matthieu Fertré <mat...@ke...> Date: Tue Apr 27 13:03:15 2010 +0200 Move file_pos_read/write definitions This is used in next patch. diff --git a/fs/read_write.c b/fs/read_write.c index ef1c3e1..40ba004 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -394,23 +394,17 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_ EXPORT_SYMBOL(vfs_write); +#ifndef CONFIG_KRG_DVFS static inline loff_t file_pos_read(struct file *file) { -#ifdef CONFIG_KRG_DVFS - if (file->f_flags & O_KRG_SHARED) - file->f_pos = krg_file_pos_read(file); -#endif return file->f_pos; } static inline void file_pos_write(struct file *file, loff_t pos) { -#ifdef CONFIG_KRG_DVFS - if (file->f_flags & O_KRG_SHARED) - krg_file_pos_write(file, pos); -#endif file->f_pos = pos; } +#endif SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count) { diff --git a/include/kerrighed/dvfs.h b/include/kerrighed/dvfs.h index 87a479b..cc6b606 100644 --- a/include/kerrighed/dvfs.h +++ b/include/kerrighed/dvfs.h @@ -1,5 +1,21 @@ -/** Kerrighed Kernel Hooks **/ +#include <linux/fs.h> +#include <kerrighed/fcntl.h> +/** Kerrighed Kernel Hooks **/ loff_t krg_file_pos_read(struct file *file); void krg_file_pos_write(struct file *file, loff_t pos); void krg_put_file(struct file *file); + +static inline loff_t file_pos_read(struct file *file) +{ + if (file->f_flags & O_KRG_SHARED) + file->f_pos = krg_file_pos_read(file); + return file->f_pos; +} + +static inline void file_pos_write(struct file *file, loff_t pos) +{ + if (file->f_flags & O_KRG_SHARED) + krg_file_pos_write(file, pos); + file->f_pos = pos; +} ----------------------------------------------------------------------- Summary of changes: arch/x86/kernel/process.c | 3 - arch/x86/kerrighed/ghost.c | 2 +- fs/kdfs/address_space.c | 5 +- fs/kdfs/debug_kdfs.h | 2 +- fs/read_write.c | 38 ++------ include/kerrighed/dvfs.h | 18 ++++- include/kerrighed/faf.h | 4 +- include/kerrighed/file_stat.h | 4 + include/kerrighed/ghost_helpers.h | 6 +- include/kerrighed/krg_services.h | 10 +- ipc/krgipc_mobility.c | 4 +- ipc/msg_io_linker.c | 1 - ipc/semarray_io_linker.c | 1 - kerrighed/epm/application/app_checkpoint.c | 4 +- kerrighed/epm/application/application.c | 5 +- kerrighed/epm/checkpoint.c | 5 +- kerrighed/epm/sighand.c | 5 +- kerrighed/epm/signal.c | 4 +- kerrighed/fs/faf/faf_hooks.c | 141 +++++++++++++++++++--------- kerrighed/fs/faf/faf_server.c | 136 +++++++++++++++++++-------- kerrighed/fs/file_stat.c | 25 +++++ kerrighed/fs/mobility.c | 8 +- kerrighed/fs/regular_file_mgr.c | 46 +++++---- kerrighed/ghost/file_ghost.c | 32 +++---- kerrighed/hotplug/add.c | 8 +- kerrighed/hotplug/cluster.c | 122 ++++++------------------ kerrighed/hotplug/node_discovering.c | 2 - kerrighed/mm/mobility.c | 4 +- kerrighed/procfs/proc_pid.c | 11 ++- mm/mempool.c | 10 ++ 30 files changed, 378 insertions(+), 288 deletions(-) hooks/post-receive -- kdfs |
From: alebre <al...@us...> - 2010-05-04 11:37:43
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "kdfs". The branch, make_kdfs_compile has been updated via 762965ebbe2272674107af959aedba5e62ab1dff (commit) from 7ee3a90ed1ce78ad73dd73d9529308ed417c09ed (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 762965ebbe2272674107af959aedba5e62ab1dff Author: ad <leb...@fr...> Date: Tue May 4 10:47:28 2010 +0000 [JANITORING] remove useless code diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index 8480f36..8034466 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -31,6 +31,9 @@ int kdfs_content_readphyspage(struct content_iolinker_data *content_data, char *page_addr, loff_t pos); int kdfs_content_writephyspage(struct content_iolinker_data *content_data, char *page_addr, loff_t from, loff_t to); +/* + * Versionning management (cf. Pierre Riteau's Master thesis) + */ int kdfs_content_readphyspage_cow(struct content_iolinker_data *content_data, char *page_addr, loff_t pos); int kdfs_content_writephyspage_cow(struct content_iolinker_data *content_data, @@ -60,7 +63,6 @@ int kdfs_content_writephyspage(struct content_iolinker_data *content_data, return 0; } - /*****************************************************************************/ /* */ /* ADDRESS SPACE OPERATIONS */ @@ -84,8 +86,6 @@ int kdfs_readpage(struct file *file, struct page *page) DEBUG (DBG_PANIC, "No contentset associated.... looks really strange (inode %lu, name %s)\n", k_inode->inode->i_ino, list_entry(k_inode->inode->i_dentry.next, struct dentry, d_alias)->d_name.name); - /* TODO PRIORITY 2: test kdfs_get_page returned value */ -// k_page = kdfs_get_page(k_inode->content_setid,page->index); k_page = kdfs_get_distpage(k_inode,page->index); DEBUG(DBG_INFO, " Readpage k_page->page : %p and page %p\n", k_page->page, page); @@ -127,7 +127,6 @@ int __kdfs_prepare_write (struct file *file, struct page *page, DEBUG (DBG_PANIC, "No contentset associated.... looks really strange \n"); } - /* TODO PRIORITY 2: test kdfs_grab_page returned value */ k_page = kdfs_grab_distpage(k_inode, page->index); BUG_ON(k_page->page != page) ; k_page->offset = offset; @@ -166,10 +165,6 @@ int kdfs_write_begin (struct file *file, * Priority : 3 * Merge new kdfs_write_begin function with the older kdfs_prepare_write. */ -/* TODO Suggested by Adrien for Adrien, - * an old TODO, ... probably just remove it ;) - * cf. http://www.mail-archive.com/git...@vg.../msg03083.html - */ int __kdfs_commit_write(struct file *file, struct page *page, unsigned offset, @@ -196,8 +191,6 @@ int __kdfs_commit_write(struct file *file, * However, due to the write behind issue at such a distributed level, we have * chosen to directly call the kDDM sync functions (write through) */ -// kdfs_mark_page_dirty(k_inode->content_setid, page->index); -// __kdfs_distput_page(k_inode->content_setid, page->index); kdfs_distmark_page_dirty(k_inode, page->index); _kdfs_put_page((struct kdfs_page*)page->private); @@ -308,8 +301,6 @@ struct address_space_operations kdfs_aops = { /* */ /*****************************************************************************/ -// TODO NOW - Adrien, PROC functions, kdfs_ilocalfind is already called before kdfs_get/grab page. -// I did that just to be faster, will improve that later if the code runs ;) struct kdfs_page *kdfs_get_distpage(struct kdfs_inode *k_inode, pgoff_t page_id){ struct kdfs_page *k_page; kdfs_node_t masternode ; @@ -332,7 +323,6 @@ struct kdfs_page *kdfs_get_distpage(struct kdfs_inode *k_inode, pgoff_t page_id return k_page; } - struct kdfs_page *kdfs_get_page(kddm_set_id_t set_id, objid_t obj_id) { DEBUG(DBG_INFO, "Get object %ld from set %ld\n", obj_id, set_id); @@ -653,11 +643,6 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, DEBUG(DBG_TRACE, "After find Page count=%d\n", page_count(k_page->page)); kunmap(k_page->page); - - // TODO NOW - Adrien, check why this message occurs each time ? - if (!IS_ERR(k_page->page)) - DEBUG(DBG_ALERT, "Can't read page for file/directory = %ld and page id = %ld\n", iolinker_data->ino, contentobjid_to_pageindex(objid)); - objEntry->object = (void *) k_page; // Note: the page has not been release, this action should be perform diff --git a/fs/kdfs/debug_kdfs.h b/fs/kdfs/debug_kdfs.h index d5b7777..9b5ddbc 100644 --- a/fs/kdfs/debug_kdfs.h +++ b/fs/kdfs/debug_kdfs.h @@ -40,7 +40,7 @@ #else # define DEBUG(level, format, args...) \ do { \ - if (KDFS_DEBUG_LEVEL >= level || level == DBG_PANIC) { \ + if (KDFS_DEBUG_LEVEL >= level) { \ /*pr_debug*/printk("KDFS - %s @ (%s : %d) - %d | ", __func__, __FILE__, __LINE__, \ current->pid) ; \ /*pr_debug*/printk(format, ## args) ; \ ----------------------------------------------------------------------- Summary of changes: fs/kdfs/address_space.c | 21 +++------------------ fs/kdfs/debug_kdfs.h | 2 +- 2 files changed, 4 insertions(+), 19 deletions(-) hooks/post-receive -- kdfs |
From: Marko O. <d0...@us...> - 2010-05-03 11:58:57
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "UNNAMED PROJECT". The branch, master has been updated via 1593fa67a18a602c629d4977e63f7c58aa5c0175 (commit) via 75f2737a536175050c55083cdfbadaa669f78d09 (commit) via c5e082e1f3fb6efe32e4b559b28ec2a985967476 (commit) via f023497b8001b9fed070116c61cdbba2a0bf876d (commit) via 0d14bb2b7e5be282928be42d4db97d9e6beac3a4 (commit) via 70b3a62d69df1aa461a44548c03e24ffd9fff226 (commit) via 0a72781ff44868e49b6214487b4373cef9d509ea (commit) via 2f8872750fffeed5756271864cf727ca1421b6bb (commit) via 41a659cfca80130536a610b4a9026add37151a01 (commit) via 632e66eddc0365801d0a28d466c7d287ed242e1c (commit) via 410cea8ea7ff93329904ce46c5a4cb26854c4487 (commit) via aacdd0a378ce5a6c02caf467a420c73deb21f971 (commit) via 68cff83bc253bc1a98c1e80ce40d92adeafe01cb (commit) via d2e542a5c50ae9c6ca118b90f14f9e44444c970a (commit) via 8ee9e4f05673e7925077cfd6aa35efe58de493c1 (commit) via 3edf0f920ec33ebef515a3bb6f3d4e6c31233340 (commit) via 5cae614eb00c2a767c5c145944ee582a9c257aab (commit) via 89ef6affed571cbe036a9704f861613e3c0d2ed7 (commit) via ce81721b4696a56d35c87e6fcc73089c6b2ec211 (commit) via 8c5b4c1adc4dfea089edb11d6355181766d2297c (commit) via 7a6ee371f1b33bf0c553e6ca1c00de758cecf3fc (commit) via c05256b9e4495c2b84f89f150c8c76cab1ad4199 (commit) via 099e5372f07ed6c3e38490e067aaba7038af42c4 (commit) via fe4ddf04258d8b9a14fc5123df87f2b4c05dd73c (commit) via edd94ff6340f5b3944babe7340d2d81401deff56 (commit) via 0596a61278a04de17b62e14c9b32f97a3f4e0051 (commit) via e9af5758ca6da9df76324c381939e6db813b1cdc (commit) via 8d132d7c75176bf6a6f0eb7b33301ce5529b389a (commit) via c75bef2becb78874629bf768cb1e81eb7c9a4fd2 (commit) via 9c2054de15d34a020c564b7f29d59377892f3f65 (commit) via 687159e932d5904cee75aa9daba6ed5f350f7777 (commit) via cc85e3d760398b5eb2b270fe1370f2cb95c75b32 (commit) via aec2ea35b12bf70076f49d4cb3863d60747e7f05 (commit) via 172d11af3dec2ac5abfb93faccc5d062d3b93bcd (commit) via 9314197a9c37de61d198e2c4373338bd70154c90 (commit) via e415d89b9c5ffd772ecf2db2b99f520345605c4d (commit) via 6239eb97db3e383a52238a46eeded1a7b25b5c3f (commit) via 7e85180649ba2d57035fd6c2e47b76110d5438a5 (commit) via f39275a3c43f3cf81fd52c4ce62bea6374df6e11 (commit) via 98073b46587ff0890f9c3a9d38b4884792cd4bb6 (commit) via 4cb1b017decb9e3e56cff68e0913eeb729aa6ae9 (commit) via 0f445abd56d442253efd764c78daa7831e8c597f (commit) via 1cbd6111704e2a23089f42431019ce9048c4a11d (commit) via e7bd670c5a500b09ca14ac265dd0a04816f55b83 (commit) via 473844850fd2f67775f2d9dd7866ed382bc3b2fc (commit) via cce799e06c2119f62cc7efcc6a7e33edd47e85de (commit) via 37a8b1f6f3dc08a9fb3853464a8aa9b7aceb882a (commit) via a508df180905c66eee5bcbf92ce283575249b8ae (commit) via da5d00a2f10315c793640cd381305ddd93130551 (commit) via 1f257135ce678e094cd58a08e198e8c97ccc91dd (commit) via d736c57a97761f14bb26ff6fd100308b057c135f (commit) via 076f95d8a8cd0c9bbe537b8714bca09319485aeb (commit) via 45982ea60fe5febbda8da97e007859ea7ec04ff9 (commit) via e13b067eba4ae0743c07d0b11267a5c03edf7fe3 (commit) via 632aeb9ca5b81451d0b6a0224dd2aa49d1b72c18 (commit) via 88992c971552e3f131b7ae21b5171f24d374264e (commit) via 2fc205625a48d4b4e358502d699d7749b5b4ed7f (commit) via 0fafd330d59ba54997e19d7bd0ab871db35b272c (commit) via a24d028f947561d1f9d2bb003a52fe56161f2d0a (commit) via 351a8840ab5e04f1fed1e46ad09ff8a4780a9c44 (commit) via e48ca9edc852e98d6a6696146475063eba0c47bd (commit) via fd4ef7276c8eb2ec31b9554253f2a258bd1ee72f (commit) via ef307bd621ef037f264f794e8c8a0ae91d75c1f3 (commit) via 716caa861db81ec590d534bc8afc26b074398ab5 (commit) via 7d0db040fb4bd07e4b95712f35789c274e34aced (commit) via b0a0689b53b03357e2772ba076b67489568675ce (commit) via da393ff92685fb80076ad605c011a046e91666b5 (commit) via a2d5da04954eae8b8108ba8232dfddcd0b7ab001 (commit) via 6cd6270253f178d4fd481d99409131c04a7da738 (commit) via cadb5e68d14f66037e0b8fdb879b8d773d090542 (commit) via 5b2aa31db0be403821ab47f4c6e2b68431e86a71 (commit) via 7799c783cdf75bbc7229cf0bee0ed259a0d7a06c (commit) via 09c2bb9a93b86a028e569c703776f19c0a848a8f (commit) via 3b4876ef9e2a7aaeac69ce5cfef682c26841dee3 (commit) via 817389f03a458e2764fbb37e4b1e67c0f2f8da7f (commit) via b027843ae2ca9afc2934e3c8f969369fa9b809a3 (commit) via f2c27662b14ca87ded095fe188003a1c53b6d6df (commit) via aaf41696643a72972c85b373dd9e1bd75fdecf68 (commit) via f887ffeae9cca3bca5005a82c94fc74b224fe454 (commit) via 5dea85acb9f34ed85ca0237d187b6fd07cadca37 (commit) via d5d16dfec946816bafda8cf1de888605ef03e3ee (commit) via 9d5f2037f1a982f1063c636df22f7a1c1f31bfe1 (commit) via c7f94b048c9099d84a8b06d23a93b1d03baa43df (commit) via 4405f41c7a9b8f9ebd320c3fa2dec93db4ae9203 (commit) via 995623086548834ed9fc0d9025a24c9625c31f99 (commit) via 28341ed68b159f38d5f6c623ffac64a407f596d9 (commit) via 8637cbc92c62e396f304fb11215660f2108c91e3 (commit) via 85194462a1c983918f0995ca188370e3b32d7f79 (commit) via bc10fcaec1e5e98781c161ab9439149428283b1d (commit) via 5b81abe100192231a1d1940fe23ee5d68a0c8f2f (commit) via 331cb485ff461ecb221c834d31c0ea9eb8723878 (commit) via fcd07c58d422196d6a107a65d085b84a7a47cb0d (commit) via 801264a17e212d9230e391cbd177f3d420d24ae1 (commit) via 19cad7366d7c6ba031eb07a561915944be33933f (commit) via 450803491aa26eac163a7e0aa4252fa48f2fa91d (commit) via e239cf4d2c889a7286037738725d7e4643763434 (commit) via 65d807708bb3ec697efa4bbacae5b1cdf75b7415 (commit) via bb9e326f45959a70d37be8608bbac6c6039e487d (commit) via e6af5f88a8185d25fef91ac497fbd3351f8efbc4 (commit) via d548b1c61218963123f6a73d6e902e9c820ce8cd (commit) via 46a1b1faa17547256419ffdbdd11194da32773f3 (commit) via ab09fde159a289b526f9f2917a7e1d7d3cca9e7e (commit) via a87dc90ef1813e0576eb82063dec58a1204aef70 (commit) via d34fa6a0a7a3f8338f50003d77cedac8fc6bc115 (commit) via 7355f94533d026b896342b94502300eaae657c9c (commit) via 7f0f0100743189c42b5a835ef8b62a8faf151cb2 (commit) via 9c0e6f98ea5597f489a94b2d64aa966eca98acd7 (commit) via f0f3b150685e3f84c7f8230fd0df40c7ff2359a2 (commit) via 11df213beb9d6a661b0accf27bdd05510229f2d2 (commit) via 9ce65cb4a0361b6ef9e78e550c46c966bf05a4c6 (commit) via 9668f34a45c546a45545192c50d7840e707f67e4 (commit) via 0e7968f92003bf394b5e8f3bb40eb81ca20157cb (commit) via 892de7ed5fabf26c73fd2fd1990ef49a9d8d619d (commit) via 72515eb378aec1633454a3ba28f7998b7b8d1d63 (commit) via 72f56a5d2e94b4a9f6d8f94d8e3172edc8ff7788 (commit) via 187bad1bd5034ee6fe896183608cf4c5830b7adb (commit) via c44c6b886182529c1e90e516098aac36cf8ee8a2 (commit) via 7c33b7b7841e593bdf87dd6011f6e9ac0a8a1de5 (commit) via db666db7647d0c744901fee958df777cb385065f (commit) via 6726d4c6f3a5d44b74cd9e870a508e782232c878 (commit) via 0644e20bcdc87c17c369118ee5e0b2eabcfce859 (commit) via 5f86fcbb7a782e6b4098ca4ca984aa59a03feac2 (commit) via f713d11387ea203419e7d1a7382740f84cd9f32d (commit) via 6c387b25491387cf8c25636382659de85c32b94e (commit) via 186cbdbe34a7e27f3da67f7352ca11d650f82282 (commit) via d341fcf6702cc026b8c65dc3933ce5ee4d4b8bc4 (commit) via 22912a5a5c97b1b051a38e45ea5258e38fe4a77c (commit) via c8034d58bc282802bd42668096b97723427bc5f2 (commit) via b53cad5485a17b688fe29aca90d9458ac635a53f (commit) via cc5c82e3f5cd1d9f975af3a136438cf56b98bf46 (commit) via 38d3cd3cbaf36c4bcd37712ca35b015978401fa7 (commit) via 26c203aeba4a663dba3a1716860cc8f296d0f40d (commit) via a716b0eedfa7ab7bd996139f78550ea8c652bb0f (commit) via f0b542ee2054f18f656326ba274b08b197012cf7 (commit) via 3371c43e3fc84a446e497a1ff09ed784c148a63a (commit) via 5a5cb2b57c126f70bca6d9822fa16c24974f2b54 (commit) via 79e407a2d79f77bd227d1d83fbb4a3ef162b89ba (commit) via a02629c013905e2ebe445c6df966873a8afe5ae8 (commit) via e42f335039572d2309ee2765e52834b748858fe1 (commit) via 7678925c903b98401ba2beea3e2499e58fa2d837 (commit) via f7a0f64900bcffc97355f032c1f982c4a538bb09 (commit) via f4e83edefe25b375ecaaad5e0197ca707871873a (commit) via 7340a90b2374d7f6f2a0e93d68e48bd30cdb9a67 (commit) via 5a18f8158ae16c60235890546f1574eacc57c521 (commit) via 63efc3ff6d02b1ef58c474bf6d12f738bd65e219 (commit) via 657fdf7499d7445fa5fecbc1d2bebf8bebd056e2 (commit) via de20137fbb35131a6c3a757e3fdcdfb45b54ccc0 (commit) via 6115914e81b0ea254a18b5d17b5b19753fdd40c1 (commit) via 5fe51bb53e91ff2a48889deeda749d893dfb17b6 (commit) via d77f15780f9f003097cc65dcccd6dab5300911e6 (commit) via 3a7ce294aafadf016056edeae89076b610065e36 (commit) via 5747553f98421a87593e8be903f22f1623f48fc6 (commit) via 6fea88e21bd3484fc7d505d814628cf02814d2e5 (commit) via 86e47c3a2d6d917d92251aaa69b55249be15ae93 (commit) via 771eb3210df726a200b50cfe492033f0cd9d4ca7 (commit) via fe562f770fdbc86bc0a60962f7677b0eb32be483 (commit) via 6fa30c534a7fa3177d6074477e281738105b7a1b (commit) via 65a644b0a232e5d8e6cfd57af4f80dec14d45ea2 (commit) via acd184f4e19faf5c0851b834b4a41170463033bb (commit) via 40ec4a7726c229e57edbbf9ef80195f7d014c07a (commit) via ff900b04aca489b336d7b2afa7fdba6aa5cc1097 (commit) via 16fcd8bc385ed2241082055f0b7205d58d76c75f (commit) via aeb1cf93d978240d156b070c3c9899f26e7f4638 (commit) via e0c7717f7684f3393936bf7dbdc8b1d3260dd8f8 (commit) via 9d048fd632cc318da203f72deb129e8ac82de8c5 (commit) via 3c75fba69aff81a385e89b58e4ea6237d37490de (commit) via 09468f4c19070c94ecf7c0c476d6e0daae17812a (commit) via d6c9d7a3f5c2f368b62a00ee74381205de65bc22 (commit) via 5e483adca3d34bbc20e3825440f604e6b3da4d56 (commit) from 4078b40ab923092c6ef6b49dac3e885bafadbe56 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 1593fa67a18a602c629d4977e63f7c58aa5c0175 Merge: 4078b40 75f2737 Author: Marko Obrovac <mar...@in...> Date: Mon May 3 14:34:32 2010 +0200 Merge branch 'master' of git://mirrors.git.kernel.org/cluster/kerrighed/tools Conflicts: .gitignore scripts/Makefile.in tools/Makefile.am diff --cc .gitignore index 9cc9f4d,125fdfe..1a4fbd5 --- a/.gitignore +++ b/.gitignore @@@ -56,7 -58,8 +58,15 @@@ ncscope. /stamp-h1 Makefile.in Makefile ++<<<<<<< HEAD + +tools/* +!tools/*.c +!tools/Makefile.am ++======= + py-compile + + # Generated archive + /kerrighed-*.tar.gz + /kerrighed-*.tar.bz2 ++>>>>>>> 75f2737a536175050c55083cdfbadaa669f78d09 diff --cc tools/Makefile.am index 9ccb68d,a3d7aad..8c055bd --- a/tools/Makefile.am +++ b/tools/Makefile.am @@@ -6,13 -6,9 +6,12 @@@ ### Author: ### Jean Parpaillon <jea...@ke...> ### + +sbindir=$(exec-prefix)/sbin + - dist_bin_SCRIPTS = krg_legacy_scheduler krgboot_helper krginit_helper - - bin_PROGRAMS = migrate checkpoint restart krgadm krgcapset krgcr-run krgboot krginit ipccheckpoint ipcrestart netclient kdfs_stat - sbin_PROGRAMS = mkfs.kdfs + dist_sbin_SCRIPTS = krginit_helper krg_legacy_scheduler + bin_PROGRAMS = migrate checkpoint restart krgcapset krgcr-run ipccheckpoint ipcrestart -sbin_PROGRAMS = krgadm krginit ++sbin_PROGRAMS = krgadm krginit mkfs.kdfs INCLUDES = -I@top_srcdir@/libs/include LDADD = @top_builddir@/libs/libkerrighed/libkerrighed.la @top_builddir@/libs/libkrgcb/libkrgcb.la @@@ -26,21 -23,46 +26,49 @@@ krgcr_run_SOURCES = krgcr-run. krginit_SOURCES = krginit.c ipccheckpoint_SOURCES = ipccheckpoint.c ipcrestart_SOURCES = ipcrestart.c +mkfs_kdfs_SOURCES = mkfs_kdfs.c +netclient_SOURCES = netclient.c +kdfs_stat_SOURCES = kdfs_stat.c - EXTRA_DIST = krginit_helper.conf + EXTRA_DIST = \ + krginit_helper.conf \ + krginit_helper.in \ + kerrighed.default \ + kerrighed.init \ + kerrighed.completion + + CLEANFILES = krginit_helper + + edit = sed \ + -e 's|@bindir[@]|$(bindir)|g' \ + -e 's|@sbindir[@]|$(sbindir)|g' \ + -e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \ + -e 's|@prefix[@]|$(prefix)|g' \ + -e 's|@sysconfdir[@]|$(sysconfdir)|g' - if USER_INSTALL - local_sysconfdir = $(sysconfdir) - else - local_sysconfdir = /etc + if ENABLE_PRESERVE_CONF + preserve = -p endif - install-data-local: - $(install_sh_SCRIPT) $(srcdir)/krginit_helper.conf $(DESTDIR)$(local_sysconfdir)/kerrighed/krginit_helper.conf + install-data-local: krginit_helper.conf kerrighed.completion kerrighed.init kerrighed.default + $(install_sh_DATA) $(preserve) $(srcdir)/krginit_helper.conf $(DESTDIR)$(sysconfdir)/kerrighed/krginit_helper.conf + $(install_sh_DATA) $(srcdir)/kerrighed.completion $(DESTDIR)$(sysconfdir)/bash_completion.d/kerrighed + $(install_sh_SCRIPT) $(srcdir)/kerrighed.init $(DESTDIR)$(sysconfdir)/init.d/kerrighed + $(install_sh_DATA) $(preserve) $(srcdir)/kerrighed.default $(DESTDIR)$(sysconfdir)/default/kerrighed uninstall-local: - rm -f $(DESTDIR)$(local_sysconfdir)/kerrighed/krginit_helper.conf + rm -f $(DESTDIR)$(sysconfdir)/kerrighed/krginit_helper.conf + rm -f $(DESTDIR)$(sysconfdir)/init.d/kerrighed + rm -f $(DESTDIR)$(sysconfdir)/default/kerrighed + rm -f $(DESTDIR)$(sysconfdir)/bash_completion.d/kerrighed + + krginit_helper: Makefile + rm -f $@ $@.tmp + srcdir=''; \ + test -f ./$@.in || srcdir=$(srcdir)/; \ + $(edit) $${srcdir}$@.in >$@.tmp + chmod +x $@.tmp + chmod go-w $@.tmp + mv $@.tmp $@ + + krginit_helper: krginit_helper.in commit 75f2737a536175050c55083cdfbadaa669f78d09 Author: Louis Rilling <lou...@ke...> Date: Wed Apr 28 16:09:33 2010 +0200 kerrighed-host.default: Make BOOT_ID=-1 the default Setting BOOT_ID to a valid node id cannot be a consistent default since depending on users' setup, the Kerrighed container will be automatically booted or not. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tools-host/kerrighed-host.default.in b/tools-host/kerrighed-host.default.in index 31433bf..70cd50b 100644 --- a/tools-host/kerrighed-host.default.in +++ b/tools-host/kerrighed-host.default.in @@ -4,7 +4,8 @@ #===================================================== # Start Kerrighed container on this node. If -1, does not start container. -BOOT_ID=1 +BOOT_ID=-1 +#BOOT_ID=1 # Local namespaces to isolate Kerrighed from # Leaving unset won't change kernel's current settings commit c5e082e1f3fb6efe32e4b559b28ec2a985967476 Author: Louis Rilling <lou...@ke...> Date: Wed Apr 28 15:26:47 2010 +0200 kerrighed.init: Fix exit status on wrong invocation Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tools/kerrighed.init b/tools/kerrighed.init index 4c231ba..ff1d927 100755 --- a/tools/kerrighed.init +++ b/tools/kerrighed.init @@ -145,7 +145,7 @@ else ;; *) log_success_msg "Usage: $SCRIPTNAME {start|stop|restart|status}" - STATU=1 + STATUS=1 ;; esac fi commit f023497b8001b9fed070116c61cdbba2a0bf876d Author: Louis Rilling <lou...@ke...> Date: Wed Apr 28 15:25:51 2010 +0200 kerrighed.init: Configure the scheduler only on the boot node Note: While closing a race condition, this also prevents /etc/init.d/kerrighed from not starting the cluster automatically but still automatically configuring the scheduler. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tools/kerrighed.init b/tools/kerrighed.init index 0003729..4c231ba 100755 --- a/tools/kerrighed.init +++ b/tools/kerrighed.init @@ -51,6 +51,25 @@ d_trigger_krg_legacy_scheduler() { krg_legacy_scheduler > /dev/null 2>&1 } +d_start_scheduler() { + log_progress_msg "scheduler" + + case "x$LEGACY_SCHED" in + xtrue) + d_trigger_krg_legacy_scheduler & + ;; + xfalse) + log_progress_msg "disabled in $CFG" + ;; + *) + log_progress_msg "value of LEGACY_SCHED in $CFG must be either 'true' or 'false'" + STATUS=1 + ;; + esac + + return ${STATUS:-0} +} + # # Function that starts the daemon/service. # @@ -66,9 +85,12 @@ d_start() { log_progress_msg "cluster" krgadm cluster start > /dev/null STATUS=$? - if [ "$STATUS" == 0 -a -n "$START_OPTS" ]; then - krgadm nodes add $START_OPTS > /dev/null - STATUS=$? + if [ $STATUS -eq 0 ]; then + if [ -n "$START_OPTS" ]; then + krgadm nodes add $START_OPTS > /dev/null + STATUS=$? + fi + d_start_scheduler fi ;; xfalse) @@ -81,20 +103,6 @@ d_start() { esac fi - log_progress_msg "scheduler" - case "x$LEGACY_SCHED" in - xtrue) - d_trigger_krg_legacy_scheduler & - ;; - xfalse) - log_progress_msg "disabled in $CFG" - ;; - *) - log_progress_msg "value of LEGACY_SCHED in $CFG must be either 'true' or 'false'" - STATUS=1 - ;; - esac - log_end_msg ${STATUS:-0} return $? } commit 0d14bb2b7e5be282928be42d4db97d9e6beac3a4 Author: Jean Parpaillon <jea...@ke...> Date: Fri Apr 30 17:02:32 2010 +0200 [tools] Fix copyright message in tools diff --git a/tools/checkpoint.c b/tools/checkpoint.c index 8c78715..546bdc9 100644 --- a/tools/checkpoint.c +++ b/tools/checkpoint.c @@ -40,6 +40,7 @@ void version(char * program_name) { printf("\ %s %s\n\ +Copyright (C) 2001-2006, INRIA, Universite de Rennes 1, EDF.\n\ Copyright (C) 2010 Kerlabs.\n\ This is free software; see source for copying conditions. There is NO\n\ warranty; not even for MERCHANBILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ diff --git a/tools/krgcapset.c b/tools/krgcapset.c index 464a242..50bab9f 100644 --- a/tools/krgcapset.c +++ b/tools/krgcapset.c @@ -50,6 +50,7 @@ void version(char * program_name) { printf("\ %s %s\n\ +Copyright (C) 2001-2006, INRIA, Universite de Rennes 1, EDF\n\ Copyright (C) 2010 Kerlabs.\n\ This is free software; see source for copying conditions. There is NO\n\ warranty; not even for MERCHANBILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ diff --git a/tools/migrate.c b/tools/migrate.c index b624fe5..11e0019 100644 --- a/tools/migrate.c +++ b/tools/migrate.c @@ -22,6 +22,7 @@ void version(char * program_name) { printf("\ %s %s\n\ +Copyright (C) 2001-2006, INRIA, Universite de Rennes 1, EDF.\n\ Copyright (C) 2010 Kerlabs.\n\ This is free software; see source for copying conditions. There is NO\n\ warranty; not even for MERCHANBILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ diff --git a/tools/restart.c b/tools/restart.c index 7e1e3c2..12ed5a4 100644 --- a/tools/restart.c +++ b/tools/restart.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2001-2006, INRIA, Universite de Rennes 1, EDF. + * Copyright (C) 2010 Kerlabs. */ #define _GNU_SOURCE #include <stdio.h> @@ -41,6 +42,7 @@ void show_version(char * program_name) { printf("\ %s %s\n\ +Copyright (C) 2001-2006, INRIA, Universite de Rennes 1, EDF.\n\ Copyright (C) 2010 Kerlabs.\n\ This is free software; see source for copying conditions. There is NO\n\ warranty; not even for MERCHANBILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ commit 70b3a62d69df1aa461a44548c03e24ffd9fff226 Author: Jean Parpaillon <jea...@ke...> Date: Fri Apr 30 15:34:46 2010 +0200 Bump version to 3.0 diff --git a/configure.ac b/configure.ac index fd50e77..7682b0a 100644 --- a/configure.ac +++ b/configure.ac @@ -10,7 +10,7 @@ AC_PREREQ(2.59) dnl mandatory stuff define([gitversion], esyscmd([sh -c "which git > /dev/null && git describe | sed -e 's/kerrighed-\([^-]\+\)//' | tr -d '\n' || true"]))dnl -AC_INIT([Kerrighed], [2.5.0gitversion], [ker...@ir...]) +AC_INIT([Kerrighed], [3.0gitversion], [ker...@ir...]) AC_DEFINE(GITVERSION, "gitversion", [GIT version]) dnl check host and target commit 0a72781ff44868e49b6214487b4373cef9d509ea Author: Jean Parpaillon <jea...@ke...> Date: Fri Apr 30 15:33:49 2010 +0200 [man] Update ipcrestart manpage diff --git a/man/ipcrestart.1.xml b/man/ipcrestart.1.xml index b22c713..1f2cc58 100644 --- a/man/ipcrestart.1.xml +++ b/man/ipcrestart.1.xml @@ -16,6 +16,14 @@ <refsynopsisdiv> <cmdsynopsis> <command>ipcrestart</command> + <group choice="opt" > + <arg choice="plain" >-h</arg> + <arg choice="plain" >--help</arg> + </group> + <group choice="opt" > + <arg choice="plain" >-v</arg> + <arg choice="plain" >--version</arg> + </group> <group choice="req" > <arg choice="plain" ><replaceable>-q</replaceable></arg> <arg choice="plain" ><replaceable>-m</replaceable></arg> @@ -40,6 +48,20 @@ <variablelist> <varlistentry> + <term><option>-h</option>,<option>--help</option></term> + <listitem> + <para>Display help.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-v</option>,<option>--version</option></term> + <listitem> + <para>Display version informations.</para> + </listitem> + </varlistentry> + + <varlistentry> <term><option>-q</option></term> <listitem> <para>Use this to restore a message queue.</para> commit 2f8872750fffeed5756271864cf727ca1421b6bb Merge: 41a659c 68cff83 Author: Jean Parpaillon <jea...@ke...> Date: Fri Apr 30 15:32:53 2010 +0200 Merge branch 'master' of ssh://git.kerlabs.com/git/interne/kerrighed-tools commit 41a659cfca80130536a610b4a9026add37151a01 Author: Jean Parpaillon <jea...@ke...> Date: Mon Apr 26 17:18:51 2010 +0200 [man] Update krgadm manpage diff --git a/man/krgadm.1.xml b/man/krgadm.1.xml index 79be5e8..99b6c7d 100644 --- a/man/krgadm.1.xml +++ b/man/krgadm.1.xml @@ -1,5 +1,5 @@ <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" - "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> <refentry id='krgadm.1'> <refmeta> <refentrytitle>krgadm</refentrytitle> @@ -15,30 +15,23 @@ <cmdsynopsis> <command>krgadm</command> <group choice="opt" > - <arg choice="plain">-h</arg> - <arg choice="plain">--help</arg> + <arg choice="plain">-h</arg> + <arg choice="plain">--help</arg> + </group> + <group choice="opt" > + <arg choice="plain">-v</arg> + <arg choice="plain">--version</arg> </group> </cmdsynopsis> <cmdsynopsis> <command>krgadm</command> <arg choice="plain" >cluster</arg> <group choice="req" > - <arg choice="plain">status</arg> - <arg choice="plain">wait_start</arg> - <arg choice="plain">poweroff</arg> - <arg choice="plain">reboot</arg> - </group> - </cmdsynopsis> - <cmdsynopsis> - <command>krgadm</command> - <arg choice="plain" >cluster start</arg> - <group choice="opt" > - <arg choice="plain" >-n</arg> - <arg choice="plain" >--nodes <replaceable>node_list</replaceable></arg> - </group> - <group choice="opt"> - <arg choice="plain" >-c</arg> - <arg choice="plain" >--count <replaceable>node_count</replaceable></arg> + <arg choice="plain">start</arg> + <arg choice="plain">status</arg> + <arg choice="plain">wait_start</arg> + <arg choice="plain">poweroff</arg> + <arg choice="plain">reboot</arg> </group> </cmdsynopsis> <cmdsynopsis> @@ -88,13 +81,20 @@ <title>General Options</title> <para> <variablelist> - <varlistentry> - <term>-h</term> - <term>--help</term> - <listitem> - <para>Print help and exit</para> - </listitem> - </varlistentry> + <varlistentry> + <term>-h</term> + <term>--help</term> + <listitem> + <para>Print help and exit</para> + </listitem> + </varlistentry> + <varlistentry> + <term>-v</term> + <term>--version</term> + <listitem> + <para>Print version informations and exit</para> + </listitem> + </varlistentry> </variablelist> </para> </refsect1> @@ -103,18 +103,18 @@ <title>Modes</title> <para> <variablelist> - <varlistentry> - <term>cluster</term> - <listitem> - <para>Manage the cluster.</para> - </listitem> - </varlistentry> - <varlistentry> - <term>nodes</term> - <listitem> - <para>Manage nodes inside the cluster.</para> - </listitem> - </varlistentry> + <varlistentry> + <term>cluster</term> + <listitem> + <para>Manage the cluster.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>nodes</term> + <listitem> + <para>Manage nodes inside the cluster.</para> + </listitem> + </varlistentry> </variablelist> </para> </refsect1> @@ -123,193 +123,172 @@ <title>Cluster commands</title> <para> <variablelist> - <varlistentry> - <term> - <arg choice="plain" >start</arg> - <group choice="opt" > - <arg choice="plain" >-n</arg> - <arg choice="plain" >--nodes <replaceable>node_list</replaceable></arg> - </group> - <group choice="opt" > - <arg choice="plain" >-c</arg> - <arg choice="plain" >--count <replaceable>node_count</replaceable></arg> - </group> - </term> - <listitem> - <para> - Start the cluster with all available nodes (state present). - </para> - <para> - With the <arg choice="plain" >--nodes</arg> option, - wait for a given list of nodes before starting. - </para> - <para> - With the <arg choice="plain" >--count</arg> option, wait - for the given number of nodes to be present before - starting. - </para> - <para> - Options <arg choice="plain" >--nodes</arg> and <arg choice="plain" >--count</arg> - are mutually exclusive. - </para> - </listitem> - </varlistentry> - <varlistentry> - <term>status</term> - <listitem> - <para>Print cluster status</para> - </listitem> - </varlistentry> - <varlistentry> - <term>wait_start</term> - <listitem> - <para>Return once cluster is started</para> - </listitem> - </varlistentry> - <varlistentry> - <term>poweroff</term> - <listitem> - <para>Power off all nodes belonging to the cluster</para> - </listitem> - </varlistentry> - <varlistentry> - <term>reboot</term> - <listitem> - <para>Reboot all nodes belonging to the cluster</para> - </listitem> - </varlistentry> + <varlistentry> + <term> + <arg choice="plain" >start</arg> + </term> + <listitem> + <para> + Start the cluster on the current node. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>status</term> + <listitem> + <para>Print cluster status</para> + </listitem> + </varlistentry> + <varlistentry> + <term>wait_start</term> + <listitem> + <para>Return once cluster is started</para> + </listitem> + </varlistentry> + <varlistentry> + <term>poweroff</term> + <listitem> + <para>Power off all nodes belonging to the cluster</para> + </listitem> + </varlistentry> + <varlistentry> + <term>reboot</term> + <listitem> + <para>Reboot all nodes belonging to the cluster</para> + </listitem> + </varlistentry> </variablelist> </para> </refsect1> - <refsect1> - <title>nodes commands</title> - <para> - <variablelist> - <varlistentry> - <term> - <arg choice="plain" >status</arg> - <group choice="opt" > - <arg choice="plain" >-n</arg> - <arg choice="plain" >--nodes <replaceable>node_list</replaceable></arg> - </group> - </term> - <listitem> - <para>Prints nodes status.</para> - <para> - With the <arg choice="plain" >--nodes</arg> option, - prints only given nodes status. - </para> - </listitem> - </varlistentry> - <varlistentry> - <term> - <arg choice="plain" >add</arg> - <group choice="opt" > - <arg choice="plain" >-n</arg> - <arg choice="plain" >--nodes <replaceable>node_list</replaceable></arg> - </group> - <group choice="opt" > - <arg choice="plain" >-c</arg> - <arg choice="plain" >--count <replaceable>node_count</replaceable></arg> - </group> - <group choice="opt" > - <arg choice="plain" >-a</arg> - <arg choice="plain" >--all</arg> - </group> - </term> - <listitem> - <para> - Add nodes to the running cluster. - </para> - <para> - With the <arg choice="plain" >--nodes</arg> option, wait - for given nodes to be present, then add them to the - running cluster. - </para> - <para> - With the <arg choice="plain" >--count</arg> option, wait - for the given number of nodes to be present, then add - them to the running cluster. - </para> - <para> - With the <arg choice="plain" >--all</arg> option, add - all the available node (state present) to the running - cluster. - </para> - <para> - One of the options <arg choice="plain" >--nodes</arg>, <arg choice="plain" >--count</arg> - or <arg choice="plain" >--all</arg> must be used. - </para> - </listitem> - </varlistentry> - <varlistentry> - <term> - <arg choice="plain" >del</arg> - <group choice="opt" > - <arg choice="plain" >-n</arg> - <arg choice="plain" >--nodes <replaceable>node_list</replaceable></arg> - </group> - <group choice="opt" > - <arg choice="plain" >-c</arg> - <arg choice="plain" >--count <replaceable>node_count</replaceable></arg> - </group> - <group choice="opt" > - <arg choice="plain" >-a</arg> - <arg choice="plain" >--all</arg> - </group> - </term> - <listitem> - <para> - Remove nodes from the running cluster. - </para> - <para> - With the <arg choice="plain" >--nodes</arg> option, - remove the given list of nodes, if they are in the - cluster. - </para> - <para> - With the <arg choice="plain" >--count</arg> option, - remove the given number of nodes from the cluster. Fail - if there are no such nodes. - </para> - <para> - With the <arg choice="plain" >--all</arg> option, remove - all nodes of the cluster, except current one. - </para> - <para> - One of the options <arg choice="plain" >--nodes</arg>, <arg choice="plain" >--count</arg> - or <arg choice="plain" >--all</arg> must be used. - </para> - </listitem> - </varlistentry> - </variablelist> - </para> - </refsect1> + <refsect1> + <title>nodes commands</title> + <para> + <variablelist> + <varlistentry> + <term> + <arg choice="plain" >status</arg> + <group choice="opt" > + <arg choice="plain" >-n</arg> + <arg choice="plain" >--nodes <replaceable>node_list</replaceable></arg> + </group> + </term> + <listitem> + <para>Prints nodes status.</para> + <para> + With the <arg choice="plain" >--nodes</arg> option, + prints only given nodes status. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <arg choice="plain" >add</arg> + <group choice="opt" > + <arg choice="plain" >-n</arg> + <arg choice="plain" >--nodes <replaceable>node_list</replaceable></arg> + </group> + <group choice="opt" > + <arg choice="plain" >-c</arg> + <arg choice="plain" >--count <replaceable>node_count</replaceable></arg> + </group> + <group choice="opt" > + <arg choice="plain" >-a</arg> + <arg choice="plain" >--all</arg> + </group> + </term> + <listitem> + <para> + Add nodes to the running cluster. + </para> + <para> + With the <arg choice="plain" >--nodes</arg> option, wait + for given nodes to be present, then add them to the + running cluster. + </para> + <para> + With the <arg choice="plain" >--count</arg> option, wait + for the given number of nodes to be present, then add + them to the running cluster. + </para> + <para> + With the <arg choice="plain" >--all</arg> option, add + all the available node (state present) to the running + cluster. + </para> + <para> + One of the options <arg choice="plain" >--nodes</arg>, <arg choice="plain" >--count</arg> + or <arg choice="plain" >--all</arg> must be used. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <arg choice="plain" >del</arg> + <group choice="opt" > + <arg choice="plain" >-n</arg> + <arg choice="plain" >--nodes <replaceable>node_list</replaceable></arg> + </group> + <group choice="opt" > + <arg choice="plain" >-c</arg> + <arg choice="plain" >--count <replaceable>node_count</replaceable></arg> + </group> + <group choice="opt" > + <arg choice="plain" >-a</arg> + <arg choice="plain" >--all</arg> + </group> + </term> + <listitem> + <para> + Remove nodes from the running cluster. + </para> + <para> + With the <arg choice="plain" >--nodes</arg> option, + remove the given list of nodes, if they are in the + cluster. + </para> + <para> + With the <arg choice="plain" >--count</arg> option, + remove the given number of nodes from the cluster. Fail + if there are no such nodes. + </para> + <para> + With the <arg choice="plain" >--all</arg> option, remove + all nodes of the cluster, except current one. + </para> + <para> + One of the options <arg choice="plain" >--nodes</arg>, <arg choice="plain" >--count</arg> + or <arg choice="plain" >--all</arg> must be used. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> - <refsect1> - <title>Nodes list syntax</title> - <para> - For all actions accepting a nodes list, syntax is the following: - <itemizedlist> - <listitem> - <para> - nodeslist ::= item(,item)+ - </para> - </listitem> - <listitem> - <para> - item ::= (nodeid|noderange) - </para> - </listitem> - <listitem> - <para> - noderange ::= nodeid-nodeid - </para> - </listitem> - </itemizedlist> - </para> - </refsect1> + <refsect1> + <title>Nodes list syntax</title> + <para> + For all actions accepting a nodes list, syntax is the following: + <itemizedlist> + <listitem> + <para> + nodeslist ::= item(,item)+ + </para> + </listitem> + <listitem> + <para> + item ::= (nodeid|noderange) + </para> + </listitem> + <listitem> + <para> + noderange ::= nodeid-nodeid + </para> + </listitem> + </itemizedlist> + </para> + </refsect1> <refsect1> <title>Author</title> commit 632e66eddc0365801d0a28d466c7d287ed242e1c Author: Jean Parpaillon <jea...@ke...> Date: Mon Apr 26 17:04:09 2010 +0200 [man] Update ipccheckpoint manpage diff --git a/man/ipccheckpoint.1.xml b/man/ipccheckpoint.1.xml index 21993c5..7e1dbe8 100644 --- a/man/ipccheckpoint.1.xml +++ b/man/ipccheckpoint.1.xml @@ -15,6 +15,14 @@ <refsynopsisdiv> <cmdsynopsis> <command>ipccheckpoint</command> + <group choice="opt" > + <arg choice="plain" >-h</arg> + <arg choice="plain" >--help</arg> + </group> + <group choice="opt" > + <arg choice="plain" >-v</arg> + <arg choice="plain" >--version</arg> + </group> <group choice="req" > <arg choice="plain" ><replaceable>-q</replaceable></arg> <arg choice="plain" ><replaceable>-m</replaceable></arg> @@ -37,6 +45,20 @@ <variablelist> <varlistentry> + <term><option>-h</option>,<option>--help</option></term> + <listitem> + <para>Display help.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-v</option>,<option>--version</option></term> + <listitem> + <para>Display version informations.</para> + </listitem> + </varlistentry> + + <varlistentry> <term><option>-q</option></term> <listitem> <para>Use this to checkpoint a message queue.</para> commit 410cea8ea7ff93329904ce46c5a4cb26854c4487 Author: Jean Parpaillon <jea...@ke...> Date: Mon Apr 26 17:00:50 2010 +0200 [man] Update checkpoint manpage diff --git a/man/checkpoint.1.xml b/man/checkpoint.1.xml index ddf37a4..13e8533 100644 --- a/man/checkpoint.1.xml +++ b/man/checkpoint.1.xml @@ -70,6 +70,14 @@ </varlistentry> <varlistentry> + <term><option>-v</option></term> + <term><option>--version</option></term> + <listitem> + <para>Print version informations and exit.</para> + </listitem> + </varlistentry> + + <varlistentry> <term><option>-a</option></term> <term><option>--from-appid</option></term> <listitem> commit aacdd0a378ce5a6c02caf467a420c73deb21f971 Author: Jean Parpaillon <jea...@ke...> Date: Mon Apr 26 16:59:24 2010 +0200 [tools] Update bash completion diff --git a/tools/kerrighed.completion b/tools/kerrighed.completion index 469bd20..30bf8bc 100644 --- a/tools/kerrighed.completion +++ b/tools/kerrighed.completion @@ -1,11 +1,30 @@ # # Completion of Kerrighed tools # + +# This function complete node ids. +# $1 is one of 'online' 'present' or 'possible' +_nodes() +{ + case $1 in + 'online') + COMPREPLY=( $(compgen -W '$( command krgadm nodes | sed "/online$/!d; s/:online$//" )' -- "$cur") ) + ;; + 'present') + COMPREPLY=( $(compgen -W '$( command krgadm nodes | sed "/present$/!d; s/:present$//" )' -- "$cur") ) + ;; + 'possible') + COMPREPLY=( $(compgen -W '$( command seq 256 )' -- "$cur") ) + ;; + esac + return 0 +} + have krgcapset && _krgcapset() { local cur=$2 prev=$3 - local options='--help -h --show -s --force -f --pid -k + local options='--help -h --version -v --show -s --force -f --pid -k --effective -e --permitted -p --inheritable-effective -d --inheritable-permitted -i' local caps='+CHANGE_KERRIGHED_CAP +CAN_MIGRATE +DISTANT_FORK +USE_REMOTE_MEMORY @@ -43,50 +62,107 @@ _krgadm() local cluster_actions='status start wait_start poweroff reboot' local nodes_actions='status add del' local nodes_status_opts='-n --nodes' - local nodes_opts='-n --nodes -a --auto' + local nodes_opts='-n --nodes -c --count -a --all' local options='--help -h' COMPREPLY=() - case "${prev}" in - cluster) - COMPREPLY=( $(compgen -W "${cluster_actions}" -- ${cur}) ) - return 0 - ;; - nodes) + case "${prev}" in + cluster) + COMPREPLY=( $(compgen -W "${cluster_actions}" -- ${cur}) ) + return 0 + ;; + nodes) COMPREPLY=( $(compgen -W "${nodes_actions}" -- ${cur}) ) - return 0 - ;; - start|add|del) - COMPREPLY=( $(compgen -W "${nodes_opts}" -- ${cur}) ) - return 0 - ;; - status) - if test "${COMP_WORDS[COMP_CWORD-2]}" = "nodes"; then - COMPREPLY=( $(compgen -W "${nodes_status_opts}" -- ${cur}) ) - fi - return 0 - ;; - *) - case "${COMP_WORDS[1]}" in - cluster) - return 0 - ;; - nodes) - return 0 - ;; - esac - ;; + return 0 + ;; + add|del) + COMPREPLY=( $(compgen -W "${nodes_opts}" -- ${cur}) ) + return 0 + ;; + status) + if [ "${COMP_WORDS[COMP_CWORD-2]}" = "nodes" ]; then + COMPREPLY=( $(compgen -W "${nodes_status_opts}" -- ${cur}) ) + fi + return 0 + ;; + -n|--nodes) + _nodes 'possible' + return 0 + ;; + *) + case "${COMP_WORDS[1]}" in + cluster) + return 0 + ;; + nodes) + return 0 + ;; + esac + ;; esac if [[ "${cur}" == -* ]]; then # return one of the possible options - COMPREPLY=( $(compgen -W "${options}" -- ${cur} ) ) + COMPREPLY=( $(compgen -W "${options}" -- ${cur} ) ) else # return one of the possible modes - COMPREPLY=( $(compgen -W "${modes}" -- ${cur}) ) + COMPREPLY=( $(compgen -W "${modes}" -- ${cur}) ) fi return 0 } [ -n "${have:-}" ] && complete -F _krgadm krgadm + +have checkpoint && +_checkpoint() +{ + local cur=$2 prev=$3 + local options='-h --help -v --version -a --from-appid -f --freeze -u --unfreeze -c --ckpt-only -k --kill -i --ignore-unsupported-files -d --description' + COMPREPLY=() + + case "${prev}" in + -u|--unfreeze) + _signals + return 0 + ;; + -k|--kill) + _signals + return 0 + ;; + *) + return 0 + _pids + ;; + esac + + COMPREPLY=( $(compgen -W "${options}" -- ${cur}) ) + return 0 +} +[ -n "${have:-}" ] && complete -F _checkpoint checkpoint + +have migrate && +_migrate() +{ + local cur=$2 prev=$3 + local options='-h --help -v --version' + COMPREPLY=() + + case "${prev}" in + -h|--help|-v|--version) + return 0 + ;; + @(1|2|3|4|5|6|7|8|9)*) + _nodes 'online' + return 0 + ;; + *) + _pids + return 0 + ;; + esac + + COMPREPLY=( $(compgen -W "${options}" -- ${cur}) ) + return 0 +} +[ -n "${have:-}" ] && complete -F _migrate migrate commit 68cff83bc253bc1a98c1e80ce40d92adeafe01cb Author: Matthieu Fertré <mat...@ke...> Date: Mon Apr 26 16:26:18 2010 +0200 Kerrighed libraries are now licensed to LGPL 2.1 diff --git a/libs/COPYING b/libs/COPYING new file mode 100644 index 0000000..4362b49 --- /dev/null +++ b/libs/COPYING @@ -0,0 +1,502 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and ... [truncated message content] |
From: Marko O. <d0...@us...> - 2010-05-03 11:51:09
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "kdfs". The branch, make_kdfs_compile has been updated via 7ee3a90ed1ce78ad73dd73d9529308ed417c09ed (commit) via c0eb8e058a25bb575fbc5d146a2527d368d80e2a (commit) via 31e654e19a1b1af946b62033dc200f13629d4050 (commit) via 9da792683030b3cdb7131ff2f5c5b2e98df0b3a8 (commit) via e3a713749966ac6438c986969e8402b725b9e693 (commit) via d2593f7c9f086af1f75d84c08e957946bd7ae1cf (commit) via a3d2c111c26c425b6e76b2d80bc9d37ec0e2d549 (commit) via 3523af09d998c1c84065cf7d1911377cae3d5b06 (commit) via 2304fe3e30dfeed9b9b6e321bc0dab19eb6fa973 (commit) via 34890efc5217eb6df6fb5b1c6674ebdac68b70d8 (commit) via 30bcaeb033c2719b8440bf5772941a499fc7ad59 (commit) via fed314374b12cdf54db73c2113ef0cbc5bd2b890 (commit) via 8385be238759fd7b354c06de128f691910102a0d (commit) via d91a195aec34ea662a90616d20a0207151cb6604 (commit) via 3f0a474f830c3a11352746d604f0e7b3fbf09c64 (commit) via 4fc41538267d5d826a8a0da5aaaf9dc26b86088d (commit) via 921b611972f403d0cde246cf985123c31886f5e8 (commit) via df544dbd4c748b441efcc692597e6b0c07007a92 (commit) via 141056370e4e4a806aeb104f1bcb178b08b33783 (commit) via 2f50f9ca17c22e66a59d952080a9b40b47aa651a (commit) via ed9af5dfca2e875760c42360a3ac1afa96b26294 (commit) via d0705939b60e61454bac6007ffc65fb7fc1dcd70 (commit) via c7646fbc23acef4adc188e0ed9a5b412528753e5 (commit) via ee0e8bbb820511ae8caa2ea11905e68963abb28c (commit) via 46e7e6cc46d6d478703347dfb1fb35579f53a559 (commit) via 1d08baaf14ce6a9ae4f611e3b18165ec85326a25 (commit) via d5c8a799004f5d557b0e0b91a1b89d689b556954 (commit) via 6231c2c029210751a26078083c47a536cbd75dd0 (commit) via cfac4945cbfedf8eb274e3a08c5ccb3aca8bd38f (commit) via 85ffaaf91fd47aa05131a6e5c4cd4546486d904b (commit) via e9f2d5196dfb8b3d2c95f48b568a9d3e431f5370 (commit) via 401fb2a636f74a2ad509b1a7dcf3a999f085f099 (commit) via e39401ddc9d62f118fed5115a96c955768009cf4 (commit) via ccd40c0712f967fe9141ee84721ad3036508f567 (commit) via f9139714572d99ce11fc8945b681b7f5588dad35 (commit) via 0ef0a008a82e7942b5baf3f5828c3fde6745f363 (commit) via 195b8ecec9348a0b84544d16baec9b87fca9ed8c (commit) via c0a523251dab2555d5c88d0e8274618c1ebd4f50 (commit) via 119ff265370b835d4c9c1932f6d4f5a01513dc08 (commit) via b6505a3b9f99974a82d86ee2439d631c334d9226 (commit) via 73d9bf90481de2d34289fa5519141de00f0794a1 (commit) via e831f85933a13cfed9ea3f41f5efea2c6333103c (commit) via e1fc4c3e89c3ceea704b5fef99d5a6ca13138671 (commit) via 7fd0d33384e31b3330bde924cc2ade7c2fc1f631 (commit) via bee74c2f042313fd733d1789fa8e49ec6d38140c (commit) via 19d335da7d55dab2b704035e633f541e7d3c41ee (commit) via 46d58b10b17a6d8f42d4151d78bd02dbf304154e (commit) via 0d70a1313201e7075d6d8986c2d7df20884d224d (commit) via 09382133c772dd8d4b7ac13c4c86d19cf8bc7eb7 (commit) via 31c8fed191097cee3e9f23972c2ad41b945844d9 (commit) via a4af99caa29d7af19f3f91091c7bbee0f18a716f (commit) via bdf754633631294c14616332c240c90652bffb19 (commit) via 9e6365aa25e380bc7ebda74507ac331e03a03914 (commit) via d2837444ec74e43593b76355a08a422c279466f0 (commit) via 6990c69cd62ca535bd6e11496367e5a83a3f921e (commit) via 76469922c507b5a7909e3b9b58437b67c13572f0 (commit) via 64c4ff4a0607a916fd7021517eb806ba9113105f (commit) via 8664d9da06fcadbfd206fcc5a76a68b36e340436 (commit) via 73b812a01c825724aab20c259eaf8d2011ffcd9c (commit) via f8c65b8b2c3ccecbd47d3c303ffa4c88a3c7c998 (commit) via c5d433bcf9162a764acc8b58eae9a9f15045b3c3 (commit) via 5c7801a958c3776d8f6a7baa058aac2c591df2f5 (commit) via 7dcfb9e02b9fd176809414e6ea59760965d917bf (commit) via 46184f836577565e33d2610e1da693855b9ecdc2 (commit) via e94bb8e1d43f365dbe5d5b7e60db7a2094b9f506 (commit) via 26c7ba722549c828bae3b42e9e279331ab50e74c (commit) via ee044627b38538c0a813549cf6cceec95ef163b3 (commit) via 0b3cd02c4e129ae8b43ff0215d4dcc24d544666a (commit) via e00a1f9d6b354cd555adf1544ca8888e5449f4b8 (commit) via 473a8b166eba7ba25c52ae79d58af29fc19cce55 (commit) via 173908642c834296ca8032a97a3aac8b59c32fb8 (commit) via 7aaf0d8bfe7cdf97d2c1f9c605419aee98cccfd0 (commit) via 9b5bcc1bab98f4a242ec28be1ad67ae11adcbd7c (commit) via 9d8955607a334f2b032b9caf1670c0dc0e93f665 (commit) via cebb59460db466b72ccab0721417114ed11e6b4d (commit) via a4f081806e97d4fa00f633be1fff62941002511a (commit) via d8451d5dbc5c8843a04c82ed3cc805e830b07aad (commit) via ea292b95be3bd513b5124d97cd790ad3ef6e4842 (commit) via d1e26419e921aa5d2cabea74e04c9ba61c288f12 (commit) via 77a8d1e258662e52c85e71bcf176dbe822e86cfb (commit) via 706dcbc1d083f79629355a6c6f01de561cda3b53 (commit) via 4d7eddec0b5faa650bbfe3121a42815268f41b16 (commit) via f517a8e5d3d215b4bbedc84008cb033a70adf313 (commit) via a1cb50e034458fe4f45d7047e3ad87af561bde8b (commit) via 97c7b7ff982dce44529e56148d4d171c78db1529 (commit) via 27c6c50775e969ca2b85962de3b59a089b7f401d (commit) via 48aabeb5d9f9b27c55c1c67e80a5ea7994130d6c (commit) via c39a9a0d7400ca96235a86a180cc307944c851db (commit) via 42d04c07c65ba1a76b005005bdbd7cc787a574e7 (commit) via 9198bd16271dcb4b2f265596f559af9700ddf779 (commit) via 20b96186fece649d4cbc082121b688184e793663 (commit) via 4ac97c366d558d5a2db20b5f987c52d0c4301cdd (commit) via 74120935aa00fcfbb776ea67f474bb26a448e406 (commit) via 9b08eed7a043ccb97aed295e5ffb3cea1e0945ee (commit) via 58df2ecc9c6bb3eeaa42ae13a5769b09877dcf4f (commit) via 492cc75dad7fd458f4de0aa2411aacb9f8fdbfd8 (commit) via 7a7bd0c1221747c3a8b9fe9c5789d8c784ac2b2d (commit) via 2ced80fe8e4e9a00a0be563fabd411bdbb2ccc72 (commit) via e5d83e8ace911dccc4b785fc654261d46713c006 (commit) via 933950bdad3a5887890bce9b9d68f6af4619d27e (commit) via 9c143ffee0bd3f0a70b76f44bc34f5f7911628cc (commit) via e781acc8466995b9e22778003b87bdc9b2584092 (commit) via 0760965e61fc26c4d1be3212418d4f8cfcf66265 (commit) via f63a86f03afd991fa7214d9e977d74a4760ff7e2 (commit) via 368058813ed4310a432067c1228d605e1ed86c7b (commit) via 5ba9eb041257ab8ec1679a3c3775440f315c6705 (commit) via 3015c36b5e3e90714ef75df954479ef8c8ddd2ce (commit) via 5b58ce598d2b4ada9b9cbbc5ba7764363fe5bc67 (commit) via e01b5e5501d0212bd09c928b5f9bdfd2e1650840 (commit) via 640f30c9db4ee13ae08f4667a27a931b076199a2 (commit) via 0b07a20c5523b9f4c557f06d8986d4b4207df019 (commit) via 871ce5f35d91801dd75e48bda65266eeefb9cc68 (commit) via b2fb6fc087d0dcf4cc64154e525b19db40f9adab (commit) via cc691ee45ea454c222d68092a1cc8062b42f01a6 (commit) via 10136bd4a74620d2589d5a169925faf87a5aceac (commit) via 7942e1378de044761a06da9024149ce59e5fa88e (commit) via fe7b23af5097581075b245b05845a596103d89dd (commit) via 251c95fd1ee774bb9f5700ba6b17ba413c40f38b (commit) via 6e51e2a5148363a09dfd008b35511343f41c2362 (commit) via 3ca9b957698471d01a08e63dba3940a894bc38b9 (commit) via ba52cf0a6a33aba4f3d62748ecf5a86d1281ff2f (commit) via e7af2952d59995e172df84c7852e01c664687232 (commit) via f06110d11d390fb3cca8628b2e354ce3e6ba4d7d (commit) via e1dcb2a8058452460986e9d62066296284f95bd0 (commit) via faf28e5a073602cc517d354557c09f1900a01438 (commit) via da274f7063c398314983a78f7fe36e0ddc589e5d (commit) via d3e04cd53b060b5bec6eb0d75617ffaeba7ccb52 (commit) via 79f66c81d7ace1d6d845803f18a7610ef7e587d7 (commit) via b3bc2c7c85b8bcd3adb103e3ede3d0a4f1ddb794 (commit) via 7c5b5c786e5088913e39f1994e887a00cac9f99a (commit) via c2b00ca75cbdc521dbb706b498401ec5d5c334fa (commit) via ce4c1725da4c2df7b3fca087c63e2f73e21e600e (commit) via d666295818cd24eef2aea8fd900273f2e0cb25c1 (commit) via 6f9ed8c3309abd1ec41809a7386e12d0639313f8 (commit) via 4827c79f868b6a215e4aa26f2b364d21815e60b1 (commit) via 510136ac46d5aeecc94c6a517515ee38ce683e29 (commit) via 8fc1e89900a3a2a604df9485ce6669eb06b31f06 (commit) via 82507b2d84008ce4f674e81a58af8d3852701c01 (commit) via 7cd16e6192fd97375d0410fe0f9fdf0b1d669925 (commit) via 3a61984be7606d9329b57ad13ae9ea049b20739b (commit) via 51e03f02a90bb099681eacb3e76f87d5b38b80c7 (commit) via 5b7590544e1126495a36c808cd77cd52e9c76f95 (commit) via bfb83c7e2e50e349447c7788d8076b2bc71b9502 (commit) via a8a652507dc2c766061be61ea30d71f5ff0a6ee7 (commit) via b38ad2a5dcf05e595293cfda22034caf5a3c2322 (commit) via 016cb110a2178d8768c60515248d3c0a4b0866ef (commit) via aec8b5774cb5ff590202fb32f563830d7f77ab2b (commit) via 71e89bc375bfea3128af96fa947725ceba3dd4d5 (commit) via 05d9a23cdf879aec8f0fe5212423cbae73c9495f (commit) via d61cab8fdd2f4bfa9c2a661e7cde681bcf60dc98 (commit) via 22289681118928532c6aa26225be70ef389597b7 (commit) via 17293966c150dd127153fc7fa8a28143c109aa4d (commit) via b867870c019b859e64e41e6af83b79cc6199d88e (commit) via 9e1d8ab7bc90cbcc3ca175f5e81aabebcf220e22 (commit) via a6dd43f0b20567f736cdfd0830ea6c5236efde97 (commit) via bafe769c58dadbda6bd01d351a04773554fee9ab (commit) via b2aaadd5286dcdaf46ab2abafbef408497e36d89 (commit) from 5a3bf8826dd301491d29a753c4b833ff46f1458e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 7ee3a90ed1ce78ad73dd73d9529308ed417c09ed Merge: c0eb8e0 5a3bf88 Author: Marko Obrovac <mar...@in...> Date: Mon May 3 14:26:25 2010 +0200 Merge branch 'make_kdfs_compile' of ssh://kdfs.git.sourceforge.net/gitroot/kdfs/kernel into make_kdfs_compile commit c0eb8e058a25bb575fbc5d146a2527d368d80e2a Merge: eeac43c 31e654e Author: Marko Obrovac <mar...@in...> Date: Mon May 3 13:51:45 2010 +0200 Merge branch 'master' of git://mirrors.git.kernel.org/cluster/kerrighed/kernel into make_kdfs_compile commit 31e654e19a1b1af946b62033dc200f13629d4050 Author: Louis Rilling <lou...@ke...> Date: Thu Apr 29 18:02:30 2010 +0200 [BUGFIX] migration: Fix procfs crash during migration Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/fs/proc/base.c b/fs/proc/base.c index 5256ff2..09f63c8 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2883,8 +2883,21 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct result = proc_pid_instantiate(dir, dentry, task, NULL); #if defined(CONFIG_KRG_PROCFS) && defined(CONFIG_KRG_EPM) if (current->nsproxy->krg_ns - && IS_ERR(result) && task->exit_state == EXIT_MIGRATION) - result = krg_proc_pid_lookup(dir, dentry, tgid); + && IS_ERR(result) && task->exit_state == EXIT_MIGRATION) { + /* + * proc_pid_instantiate() may have instantiated dentry, but we + * don't know, so restart with a fresh one. + */ + result = ERR_PTR(-ENOMEM); + dentry = d_alloc(dentry->d_parent, &dentry->d_name); + if (dentry) { + result = krg_proc_pid_lookup(dir, dentry, tgid); + if (!result) + result = dentry; + else + dput(dentry); + } + } #endif put_task_struct(task); out: commit 9da792683030b3cdb7131ff2f5c5b2e98df0b3a8 Author: Louis Rilling <lou...@ke...> Date: Fri Apr 30 11:53:11 2010 +0200 [BUGFIX] krgcap: Access real parent's caps, not ptracer's ones Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/kerrighed/capability/capability.c b/kerrighed/capability/capability.c index 9d1aeac..ef5117f 100644 --- a/kerrighed/capability/capability.c +++ b/kerrighed/capability/capability.c @@ -177,9 +177,9 @@ static int krg_set_father_cap(struct task_struct *tsk, read_lock(&tasklist_lock); #ifdef CONFIG_KRG_EPM - if (tsk->parent != baby_sitter) { + if (tsk->real_parent != baby_sitter) { #endif - retval = krg_set_cap(tsk->parent, requested_cap); + retval = krg_set_cap(tsk->real_parent, requested_cap); read_unlock(&tasklist_lock); #ifdef CONFIG_KRG_EPM } else { @@ -283,9 +283,9 @@ static int krg_get_father_cap(struct task_struct *son, read_lock(&tasklist_lock); #ifdef CONFIG_KRG_EPM - if (son->parent != baby_sitter) { + if (son->real_parent != baby_sitter) { #endif - retval = krg_get_cap(son->parent, resulting_cap); + retval = krg_get_cap(son->real_parent, resulting_cap); read_unlock(&tasklist_lock); #ifdef CONFIG_KRG_EPM } else { @@ -304,7 +304,7 @@ static int krg_get_father_cap(struct task_struct *son, resulting_cap); krg_get_parent(parent_children_obj, son, &parent_pid, &real_parent_pid); - retval = remote_get_pid_cap(parent_pid, resulting_cap); + retval = remote_get_pid_cap(real_parent_pid, resulting_cap); krg_children_unlock(parent_children_obj); } #endif commit e3a713749966ac6438c986969e8402b725b9e693 Author: Louis Rilling <lou...@ke...> Date: Thu Apr 29 16:39:00 2010 +0200 [BUGFIX] ptrace: Fix deadlock at ptracee's exit Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/kerrighed/proc/krg_exit.c b/kerrighed/proc/krg_exit.c index 957a5bf..9536619 100644 --- a/kerrighed/proc/krg_exit.c +++ b/kerrighed/proc/krg_exit.c @@ -570,7 +570,7 @@ void krg_finish_exit_notify(struct task_struct *task, int signal, void *cookie) struct children_kddm_object *parent_children_obj = cookie; pid_t parent_pid; - if (task->parent == baby_sitter) + if (task->task_obj) parent_pid = task->task_obj->parent; else parent_pid = task_pid_knr(task->parent); commit d2593f7c9f086af1f75d84c08e957946bd7ae1cf Author: Louis Rilling <lou...@ke...> Date: Wed Apr 28 16:29:43 2010 +0200 [BUGFIX] krgepm: Disable krg_current before congestion_wait() Memory reclaim can happen while calling copy_process() with krg_current, memory reclaim may call congestion_wait(), and congestion_wait() registers current in a waitqueue. Make sure that krg_current is not registered in place of the true current task. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 493b468..22c0378 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -315,7 +315,11 @@ EXPORT_SYMBOL(set_bdi_congested); * write congestion. If no backing_devs are congested then just wait for the * next write to be completed. */ +#ifdef CONFIG_KRG_EPM +static long __congestion_wait(int rw, long timeout) +#else long congestion_wait(int rw, long timeout) +#endif { long ret; DEFINE_WAIT(wait); @@ -326,5 +330,20 @@ long congestion_wait(int rw, long timeout) finish_wait(wqh, &wait); return ret; } + +#ifdef CONFIG_KRG_EPM +long congestion_wait(int rw, long timeout) +{ + struct task_struct *krg_cur; + long ret; + + krg_cur = krg_current; + krg_current = NULL; + ret = __congestion_wait(rw, timeout); + krg_current = krg_cur; + + return ret; +} +#endif EXPORT_SYMBOL(congestion_wait); commit a3d2c111c26c425b6e76b2d80bc9d37ec0e2d549 Author: Louis Rilling <lou...@ke...> Date: Tue Apr 27 16:32:01 2010 +0200 krg_faf_sendmsg/recvmsg: Fix types of size parameters Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/include/kerrighed/faf.h b/include/kerrighed/faf.h index 0eb98a9..6640867 100644 --- a/include/kerrighed/faf.h +++ b/include/kerrighed/faf.h @@ -79,10 +79,10 @@ long krg_faf_setsockopt(struct file *file, int level, int optname, char __user *optval, int optlen); long krg_faf_getsockopt(struct file *file, int level, int optname, char __user *optval, int __user *optlen); -long krg_faf_sendmsg(struct file *file, struct msghdr *msg, - int total_len); -long krg_faf_recvmsg(struct file *file, struct msghdr *msg, - int total_len, unsigned int flags); +ssize_t krg_faf_sendmsg(struct file *file, struct msghdr *msg, + size_t total_len); +ssize_t krg_faf_recvmsg(struct file *file, struct msghdr *msg, + size_t total_len, unsigned int flags); int krg_faf_poll_wait(struct file *file, int wait); void krg_faf_poll_dequeue(struct file *file); diff --git a/kerrighed/fs/faf/faf_hooks.c b/kerrighed/fs/faf/faf_hooks.c index 0c6fee1..9cdb365 100644 --- a/kerrighed/fs/faf/faf_hooks.c +++ b/kerrighed/fs/faf/faf_hooks.c @@ -1317,13 +1317,13 @@ err_cancel: goto out_end; } -long krg_faf_sendmsg (struct file * file, - struct msghdr *msghdr, - int total_len) +ssize_t krg_faf_sendmsg(struct file *file, struct msghdr *msghdr, + size_t total_len) { faf_client_data_t *data = file->private_data; struct faf_sendmsg_msg msg; - int r, err; + ssize_t r; + int err; struct rpc_desc* desc; msg.server_fd = data->server_fd; @@ -1361,14 +1361,13 @@ cancel: goto out_end; } -long krg_faf_recvmsg(struct file * file, - struct msghdr *msghdr, - int total_len, - unsigned int flags) +ssize_t krg_faf_recvmsg(struct file *file, struct msghdr *msghdr, + size_t total_len, unsigned int flags) { faf_client_data_t *data = file->private_data; struct faf_sendmsg_msg msg; - int r, err; + ssize_t r; + int err; struct rpc_desc* desc; msg.server_fd = data->server_fd; diff --git a/kerrighed/fs/faf/faf_server.c b/kerrighed/fs/faf/faf_server.c index 82a2e6f..ce69ff5 100644 --- a/kerrighed/fs/faf/faf_server.c +++ b/kerrighed/fs/faf/faf_server.c @@ -1355,7 +1355,8 @@ void handle_faf_sendmsg(struct rpc_desc *desc, void *msgIn, size_t size) { struct faf_sendmsg_msg *msg = msgIn; - int r, err; + ssize_t r; + int err; struct msghdr msghdr; err = recv_msghdr(desc, &msghdr, msg->total_len, 0); @@ -1390,7 +1391,8 @@ void handle_faf_recvmsg(struct rpc_desc *desc, void *msgIn, size_t size) { struct faf_sendmsg_msg *msg = msgIn; - int r, err; + ssize_t r; + int err; struct msghdr msghdr; err = recv_msghdr(desc, &msghdr, msg->total_len, MSG_HDR_ONLY); commit 3523af09d998c1c84065cf7d1911377cae3d5b06 Author: Louis Rilling <lou...@ke...> Date: Mon Apr 26 16:10:43 2010 +0200 krgfaf: Support readv() and writev() Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/fs/read_write.c b/fs/read_write.c index 58d276b..ef1c3e1 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -731,6 +731,10 @@ ssize_t vfs_readv(struct file *file, const struct iovec __user *vec, { if (!(file->f_mode & FMODE_READ)) return -EBADF; +#ifdef CONFIG_KRG_FAF + if (file->f_flags & O_FAF_CLT) + return krg_faf_readv(file, vec, vlen, pos); +#endif if (!file->f_op || (!file->f_op->aio_read && !file->f_op->read)) return -EINVAL; @@ -744,6 +748,10 @@ ssize_t vfs_writev(struct file *file, const struct iovec __user *vec, { if (!(file->f_mode & FMODE_WRITE)) return -EBADF; +#ifdef CONFIG_KRG_FAF + if (file->f_flags & O_FAF_CLT) + return krg_faf_writev(file, vec, vlen, pos); +#endif if (!file->f_op || (!file->f_op->aio_write && !file->f_op->write)) return -EINVAL; diff --git a/include/kerrighed/faf.h b/include/kerrighed/faf.h index be0c8c2..0eb98a9 100644 --- a/include/kerrighed/faf.h +++ b/include/kerrighed/faf.h @@ -7,6 +7,7 @@ #include <linux/namei.h> struct file; +struct iovec; struct kstat; struct statfs; @@ -36,6 +37,10 @@ long krg_faf_llseek(struct file *file, unsigned long offset_high, ssize_t krg_faf_read(struct file *file, char *buf, size_t count); ssize_t krg_faf_write(struct file *file, const char *buf, size_t count); +ssize_t krg_faf_readv(struct file *file, const struct iovec __user *vec, + unsigned long vlen, loff_t *pos); +ssize_t krg_faf_writev(struct file *file, const struct iovec __user *vec, + unsigned long vlen, loff_t *pos); long krg_faf_fcntl(struct file *file, unsigned int cmd, unsigned long arg); long krg_faf_fcntl64(struct file *file, unsigned int cmd, diff --git a/include/net/krgrpc/rpcid.h b/include/net/krgrpc/rpcid.h index dcf917e..05ee42c 100644 --- a/include/net/krgrpc/rpcid.h +++ b/include/net/krgrpc/rpcid.h @@ -12,6 +12,8 @@ enum rpcid { RPC_FAF_INIT_SERVER, RPC_FAF_READ, RPC_FAF_WRITE, + RPC_FAF_READV, + RPC_FAF_WRITEV, RPC_FAF_LSEEK, RPC_FAF_LLSEEK, RPC_FAF_IOCTL, diff --git a/kerrighed/fs/faf/faf_hooks.c b/kerrighed/fs/faf/faf_hooks.c index ec91d37..0c6fee1 100644 --- a/kerrighed/fs/faf/faf_hooks.c +++ b/kerrighed/fs/faf/faf_hooks.c @@ -8,6 +8,7 @@ #include <linux/fs_struct.h> #include <linux/mount.h> #include <linux/file.h> +#include <linux/uio.h> #include <linux/namei.h> #include <linux/socket.h> #include <linux/sched.h> @@ -321,6 +322,134 @@ err: return r; } +ssize_t krg_faf_readv(struct file *file, const struct iovec __user *vec, + unsigned long vlen, loff_t *pos) +{ + faf_client_data_t *data = file->private_data; + struct faf_rw_msg msg; + struct faf_rw_ret ret; + struct iovec iovstack[UIO_FASTIOV]; + struct iovec *iov = iovstack; + int iovcnt; + size_t total_len; + struct rpc_desc *desc; + int err; + + ret.ret = rw_copy_check_uvector(READ, vec, vlen, + ARRAY_SIZE(iovstack), iovstack, &iov); + if (ret.ret < 0) + return ret.ret; + iovcnt = vlen; + total_len = ret.ret; + + ret.ret = -ENOMEM; + desc = rpc_begin(RPC_FAF_READV, data->server_id); + if (!desc) + goto out; + + msg.server_fd = data->server_fd; + msg.count = total_len; + msg.pos = *pos; + err = rpc_pack_type(desc, msg); + if (err) + goto cancel; + + err = unpack_remote_sleep_res_prepare(desc); + if (err) + goto cancel; + err = unpack_remote_sleep_res_type(desc, ret); + if (err) + goto cancel; + + *pos = ret.pos; + if (ret.ret <= 0) + goto out_end; + + err = recv_iov(desc, iov, iovcnt, ret.ret, MSG_USER); + if (err) + goto cancel; + +out_end: + rpc_end(desc, 0); + +out: + if (iov != iovstack) + kfree(iov); + + return ret.ret; + +cancel: + rpc_cancel(desc); + if (err > 0) + err = -EPIPE; + ret.ret = err; + goto out_end; +} + +ssize_t krg_faf_writev(struct file *file, const struct iovec __user *vec, + unsigned long vlen, loff_t *pos) +{ + faf_client_data_t *data = file->private_data; + struct faf_rw_msg msg; + struct faf_rw_ret ret; + struct iovec iovstack[UIO_FASTIOV]; + struct iovec *iov = iovstack; + int iovcnt; + size_t total_len; + struct rpc_desc *desc; + int err; + + ret.ret = rw_copy_check_uvector(WRITE, vec, vlen, + ARRAY_SIZE(iovstack), iovstack, &iov); + if (ret.ret < 0) + return ret.ret; + iovcnt = vlen; + total_len = ret.ret; + + ret.ret = -ENOMEM; + desc = rpc_begin(RPC_FAF_WRITEV, data->server_id); + if (!desc) + goto out; + + msg.server_fd = data->server_fd; + msg.count = total_len; + msg.pos = *pos; + err = rpc_pack_type(desc, msg); + if (err) + goto cancel; + + err = send_iov(desc, iov, iovcnt, total_len, MSG_USER); + if (err) + goto cancel; + + err = unpack_remote_sleep_res_prepare(desc); + if (err) + goto cancel; + err = unpack_remote_sleep_res_type(desc, ret); + if (err) + goto cancel; + + *pos = ret.pos; + if (ret.ret == -EPIPE) + send_sig(SIGPIPE, current, 0); + +out_end: + rpc_end(desc, 0); + +out: + if (iov != iovstack) + kfree(iov); + + return ret.ret; + +cancel: + rpc_cancel(desc); + if (err > 0) + err = -EPIPE; + ret.ret = err; + goto out_end; +} + /** Kerrighed kernel hook for FAF ioctl function. * @author Renaud Lottiaux * diff --git a/kerrighed/fs/faf/faf_server.c b/kerrighed/fs/faf/faf_server.c index fb042f4..82a2e6f 100644 --- a/kerrighed/fs/faf/faf_server.c +++ b/kerrighed/fs/faf/faf_server.c @@ -283,6 +283,100 @@ err: return; } +static void handle_faf_readv(struct rpc_desc *desc, void *__msg, size_t size) +{ + struct faf_rw_msg *msg = __msg; + struct faf_rw_ret ret; + struct file *file; + struct iovec *iov; + int iovcnt, err; + + err = alloc_iov(&iov, &iovcnt, msg->count); + if (err) { + ret.ret = err; + iov = NULL; + } + + err = remote_sleep_prepare(desc); + if (err) + goto cancel; + + ret.pos = msg->pos; + if (iov) { + file = fget(msg->server_fd); + ret.ret = vfs_readv(file, iov, iovcnt, &ret.pos); + fput(file); + } + + remote_sleep_finish(); + + err = rpc_pack_type(desc, ret); + if (err) + goto cancel; + if (ret.ret <= 0) + goto out_free; + + err = send_iov(desc, iov, iovcnt, ret.ret, 0); + if (err) + goto cancel; + +out_free: + if (iov) + free_iov(iov, iovcnt); + + return; + +cancel: + rpc_cancel(desc); + goto out_free; +} + +static void handle_faf_writev(struct rpc_desc *desc, void *__msg, size_t size) +{ + struct faf_rw_msg *msg = __msg; + struct faf_rw_ret ret; + struct file *file; + struct iovec *iov; + int iovcnt, err; + + err = alloc_iov(&iov, &iovcnt, msg->count); + if (!err) { + err = recv_iov(desc, iov, iovcnt, msg->count, 0); + if (err) + goto cancel; + } else { + ret.ret = err; + iov = NULL; + } + + err = remote_sleep_prepare(desc); + if (err) + goto cancel; + + ret.pos = msg->pos; + if (iov) { + file = fget(msg->server_fd); + ret.ret = vfs_writev(file, iov, iovcnt, &ret.pos); + fput(file); + } + + remote_sleep_finish(); + + err = rpc_pack_type(desc, ret); + if (err) + goto cancel; + +out_free: + if (iov) + free_iov(iov, iovcnt); + + return; + +cancel: + rpc_cancel(desc); + goto out_free; +} + /** Handler for doing an IOCTL in a FAF open file. * @author Renaud Lottiaux * @@ -1360,6 +1454,8 @@ void faf_server_init (void) { rpc_register_void(RPC_FAF_READ, handle_faf_read, 0); rpc_register_void(RPC_FAF_WRITE, handle_faf_write, 0); + rpc_register_void(RPC_FAF_READV, handle_faf_readv, 0); + rpc_register_void(RPC_FAF_WRITEV, handle_faf_writev, 0); faf_poll_init(); rpc_register_void(RPC_FAF_IOCTL, handle_faf_ioctl, 0); rpc_register_void(RPC_FAF_FCNTL, handle_faf_fcntl, 0); diff --git a/kerrighed/fs/faf/faf_server.h b/kerrighed/fs/faf/faf_server.h index dc01be4..78b765f 100644 --- a/kerrighed/fs/faf/faf_server.h +++ b/kerrighed/fs/faf/faf_server.h @@ -18,6 +18,12 @@ struct faf_rw_msg { int server_fd; size_t count; + loff_t pos; +}; + +struct faf_rw_ret { + ssize_t ret; + loff_t pos; }; struct faf_d_path_msg { commit 2304fe3e30dfeed9b9b6e321bc0dab19eb6fa973 Author: Louis Rilling <lou...@ke...> Date: Mon Apr 26 16:06:02 2010 +0200 krgfaf: Expose *_iov() helpers for usage outside sendsmg()/recvmsg() Also remove a pack()/unpack() from them, assuming that all users know the total length of buffers to be transfered/allocated before calling the helpers. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/kerrighed/fs/faf/faf_hooks.c b/kerrighed/fs/faf/faf_hooks.c index 4e753d5..ec91d37 100644 --- a/kerrighed/fs/faf/faf_hooks.c +++ b/kerrighed/fs/faf/faf_hooks.c @@ -1198,7 +1198,7 @@ long krg_faf_sendmsg (struct file * file, struct rpc_desc* desc; msg.server_fd = data->server_fd; - + msg.total_len = total_len; msg.flags = msghdr->msg_flags; desc = rpc_begin(RPC_FAF_SENDMSG, data->server_id); @@ -1243,7 +1243,7 @@ long krg_faf_recvmsg(struct file * file, struct rpc_desc* desc; msg.server_fd = data->server_fd; - + msg.total_len = total_len; msg.flags = flags; desc = rpc_begin(RPC_FAF_RECVMSG, data->server_id); @@ -1267,7 +1267,7 @@ long krg_faf_recvmsg(struct file * file, if (r < 0) goto out_end; - err = recv_msghdr(desc, msghdr, MSG_USER); + err = recv_msghdr(desc, msghdr, r, MSG_USER); if (err) goto cancel; diff --git a/kerrighed/fs/faf/faf_server.c b/kerrighed/fs/faf/faf_server.c index 299d2c6..fb042f4 100644 --- a/kerrighed/fs/faf/faf_server.c +++ b/kerrighed/fs/faf/faf_server.c @@ -1264,7 +1264,7 @@ void handle_faf_sendmsg(struct rpc_desc *desc, int r, err; struct msghdr msghdr; - err = recv_msghdr(desc, &msghdr, 0); + err = recv_msghdr(desc, &msghdr, msg->total_len, 0); if (err) { rpc_cancel(desc); return; @@ -1299,7 +1299,7 @@ void handle_faf_recvmsg(struct rpc_desc *desc, int r, err; struct msghdr msghdr; - err = recv_msghdr(desc, &msghdr, MSG_HDR_ONLY); + err = recv_msghdr(desc, &msghdr, msg->total_len, MSG_HDR_ONLY); if (err) { rpc_cancel(desc); return; diff --git a/kerrighed/fs/faf/faf_server.h b/kerrighed/fs/faf/faf_server.h index d0e2f28..dc01be4 100644 --- a/kerrighed/fs/faf/faf_server.h +++ b/kerrighed/fs/faf/faf_server.h @@ -101,6 +101,7 @@ struct faf_getsockopt_msg { struct faf_sendmsg_msg { int server_fd; unsigned int flags; + size_t total_len; }; struct faf_poll_wait_msg { diff --git a/kerrighed/fs/faf/faf_tools.c b/kerrighed/fs/faf/faf_tools.c index de196cc..88e9def 100644 --- a/kerrighed/fs/faf/faf_tools.c +++ b/kerrighed/fs/faf/faf_tools.c @@ -10,11 +10,12 @@ #include "faf_tools.h" static -int send_user_iov(struct rpc_desc *desc, struct msghdr *msg, int total_len) +int send_user_iov(struct rpc_desc *desc, struct iovec *iov, int iovcnt, size_t total_len) { void *page; void __user *iov_base; - int i, iov_len, iov_offset, page_offset, max_page_offset, sent, err = 0; + size_t iov_len, iov_offset, sent; + int i, page_offset, max_page_offset, err = 0; page = (void *)__get_free_page(GFP_KERNEL); if (!page) @@ -29,11 +30,11 @@ int send_user_iov(struct rpc_desc *desc, struct msghdr *msg, int total_len) page_offset = 0; while (page_offset < max_page_offset) { - BUG_ON(i >= msg->msg_iovlen); + BUG_ON(i >= iovcnt); - iov_base = (__force void __user *)msg->msg_iov[i].iov_base + iov_base = (__force void __user *)iov[i].iov_base + iov_offset; - iov_len = msg->msg_iov[i].iov_len - iov_offset; + iov_len = iov[i].iov_len - iov_offset; if (iov_len > max_page_offset - page_offset) { iov_len = max_page_offset - page_offset; @@ -64,20 +65,21 @@ out_free: } static -int send_kernel_iov(struct rpc_desc *desc, struct msghdr *msg, int total_len) +int send_kernel_iov(struct rpc_desc *desc, struct iovec *iov, int iovcnt, size_t total_len) { - int iov_len, i, sent, err = 0; + size_t iov_len, sent; + int i, err = 0; /* FAF server is supposed to have page-backed iovecs */ for (sent = 0, i = 0; sent < total_len; sent += PAGE_SIZE, i++) { - BUG_ON(i >= msg->msg_iovlen); + BUG_ON(i >= iovcnt); - iov_len = msg->msg_iov[i].iov_len; + iov_len = iov[i].iov_len; BUG_ON(iov_len != PAGE_SIZE && sent + iov_len < total_len); if (sent + iov_len > total_len) iov_len = total_len - sent; - err = rpc_pack(desc, 0, msg->msg_iov[i].iov_base, iov_len); + err = rpc_pack(desc, 0, iov[i].iov_base, iov_len); if (err) break; } @@ -85,33 +87,26 @@ int send_kernel_iov(struct rpc_desc *desc, struct msghdr *msg, int total_len) return err; } -static int -send_iov(struct rpc_desc *desc, struct msghdr *msg, int total_len, int flags) +send_iov(struct rpc_desc *desc, struct iovec *iov, int iovcnt, size_t total_len, int flags) { int err; - err = rpc_pack_type(desc, total_len); - if (err) - return err; - - if (flags & MSG_HDR_ONLY) - return err; - if (flags & MSG_USER) - err = send_user_iov(desc, msg, total_len); + err = send_user_iov(desc, iov, iovcnt, total_len); else - err = send_kernel_iov(desc, msg, total_len); + err = send_kernel_iov(desc, iov, iovcnt, total_len); return err; } static -int recv_user_iov(struct rpc_desc *desc, struct msghdr *msg, int total_len) +int recv_user_iov(struct rpc_desc *desc, struct iovec *iov, int iovcnt, size_t total_len) { void *page; void __user *iov_base; - int i, iov_len, iov_offset, page_offset, max_page_offset, rcvd, err = 0; + size_t iov_len, iov_offset, rcvd; + int i, page_offset, max_page_offset, err = 0; page = (void *)__get_free_page(GFP_KERNEL); if (!page) @@ -133,11 +128,11 @@ int recv_user_iov(struct rpc_desc *desc, struct msghdr *msg, int total_len) page_offset = 0; while (page_offset < max_page_offset) { - BUG_ON(i >= msg->msg_iovlen); + BUG_ON(i >= iovcnt); - iov_base = (__force void __user *)msg->msg_iov[i].iov_base + iov_base = (__force void __user *)iov[i].iov_base + iov_offset; - iov_len = msg->msg_iov[i].iov_len - iov_offset; + iov_len = iov[i].iov_len - iov_offset; if (iov_len > max_page_offset - page_offset) { iov_len = max_page_offset - page_offset; @@ -164,20 +159,21 @@ out_free: } static -int recv_kernel_iov(struct rpc_desc *desc, struct msghdr *msg, int total_len) +int recv_kernel_iov(struct rpc_desc *desc, struct iovec *iov, int iovcnt, size_t total_len) { - int iov_len, i, rcvd, err = 0; + size_t iov_len, rcvd; + int i, err = 0; /* FAF server is supposed to have page-backed iovecs */ for (rcvd = 0, i = 0; rcvd < total_len; rcvd += PAGE_SIZE, i++) { - BUG_ON(i >= msg->msg_iovlen); + BUG_ON(i >= iovcnt); - iov_len = msg->msg_iov[i].iov_len; + iov_len = iov[i].iov_len; BUG_ON(iov_len != PAGE_SIZE && rcvd + iov_len < total_len); if (rcvd + iov_len > total_len) iov_len = total_len - rcvd; - err = rpc_unpack(desc, 0, msg->msg_iov[i].iov_base, iov_len); + err = rpc_unpack(desc, 0, iov[i].iov_base, iov_len); if (err) { if (err > 0) err = -EPIPE; @@ -188,82 +184,63 @@ int recv_kernel_iov(struct rpc_desc *desc, struct msghdr *msg, int total_len) return err; } -static int alloc_iov(struct msghdr *msg, int total_len) +int alloc_iov(struct iovec **iov, int *iovcnt, size_t total_len) { - struct iovec *iov; + struct iovec *__iov; int i, iovlen; iovlen = DIV_ROUND_UP(total_len, PAGE_SIZE); - iov = kmalloc(sizeof(*iov) * iovlen, GFP_KERNEL); - if (!iov) + __iov = kmalloc(sizeof(*__iov) * iovlen, GFP_KERNEL); + if (!__iov) return -ENOMEM; - msg->msg_iov = iov; - msg->msg_iovlen = iovlen; + *iov = __iov; + *iovcnt = iovlen; if (!iovlen) return 0; for (i = 0; i < iovlen; i++) { - iov[i].iov_base = (void *)__get_free_page(GFP_KERNEL); - if (!iov[i].iov_base) + __iov[i].iov_base = (void *)__get_free_page(GFP_KERNEL); + if (!__iov[i].iov_base) goto out_free; - iov[i].iov_len = PAGE_SIZE; + __iov[i].iov_len = PAGE_SIZE; } - iov[iovlen - 1].iov_len = total_len - (iovlen - 1) * PAGE_SIZE; + __iov[iovlen - 1].iov_len = total_len - (iovlen - 1) * PAGE_SIZE; return 0; out_free: for (i--; i >= 0; i--) - free_page((unsigned long)iov[i].iov_base); - kfree(iov); + free_page((unsigned long)__iov[i].iov_base); + kfree(__iov); return -ENOMEM; } -static void free_iov(struct msghdr *msg) +void free_iov(struct iovec *iov, int iovcnt) { int i; - for (i = 0; i < msg->msg_iovlen; i++) - free_page((unsigned long)msg->msg_iov[i].iov_base); - kfree(msg->msg_iov); + for (i = 0; i < iovcnt; i++) + free_page((unsigned long)iov[i].iov_base); + kfree(iov); } -static int recv_iov(struct rpc_desc *desc, struct msghdr *msg, int flags) +int recv_iov(struct rpc_desc *desc, struct iovec *iov, int iovcnt, size_t total_len, int flags) { - int total_len, err; - - err = rpc_unpack_type(desc, total_len); - if (err) { - if (err > 0) - err = -EPIPE; - return err; - } - - if (!(flags & MSG_USER)) { - err = alloc_iov(msg, total_len); - if (err) - return err; - } - - if (flags & MSG_HDR_ONLY) - return err; + int err; - if (flags & MSG_USER) { - err = recv_user_iov(desc, msg, total_len); - } else { - err = recv_kernel_iov(desc, msg, total_len); - if (err) - free_iov(msg); - } + if (flags & MSG_USER) + err = recv_user_iov(desc, iov, iovcnt, total_len); + else + err = recv_kernel_iov(desc, iov, iovcnt, total_len); return err; } int send_msghdr(struct rpc_desc* desc, struct msghdr *msghdr, - int total_len, + size_t total_len, int flags) { int err; @@ -278,13 +255,15 @@ int send_msghdr(struct rpc_desc* desc, err = rpc_pack(desc, 0, msghdr->msg_control, msghdr->msg_controllen); if (err) return err; + err = send_iov(desc, msghdr->msg_iov, msghdr->msg_iovlen, total_len, flags); } - return send_iov(desc, msghdr, total_len, flags); + return err; } int recv_msghdr(struct rpc_desc* desc, struct msghdr *msghdr, + size_t total_len, int flags) { struct msghdr tmp_msg; @@ -300,10 +279,20 @@ int recv_msghdr(struct rpc_desc* desc, err = -ENOMEM; if (flags & MSG_USER) { msg->msg_name = msghdr->msg_name; + + msg->msg_iov = msghdr->msg_iov; + msg->msg_iovlen = msghdr->msg_iovlen; } else { + int msg_iovlen; + msg->msg_name = kmalloc(msg->msg_namelen, GFP_KERNEL); if (!msg->msg_name) goto out_err; + + err = alloc_iov(&msg->msg_iov, &msg_iovlen, total_len); + if (err) + goto err_free_name; + msg->msg_iovlen = msg_iovlen; } /* @@ -312,7 +301,7 @@ int recv_msghdr(struct rpc_desc* desc, */ msg->msg_control = kmalloc(msg->msg_controllen, GFP_KERNEL); if (!msg->msg_control) - goto err_free_name; + goto err_free_iov; if (!(flags & MSG_HDR_ONLY)) { err = rpc_unpack(desc, 0, msg->msg_name, msg->msg_namelen); @@ -321,6 +310,9 @@ int recv_msghdr(struct rpc_desc* desc, err = rpc_unpack(desc, 0, msg->msg_control, msg->msg_controllen); if (err) goto err_free_control; + err = recv_iov(desc, msg->msg_iov, msg->msg_iovlen, total_len, flags); + if (err) + goto err_free_control; } if (flags & MSG_USER) { @@ -334,16 +326,6 @@ int recv_msghdr(struct rpc_desc* desc, err = -EFAULT; goto err_free_control; } - - msg->msg_iov = msghdr->msg_iov; - msg->msg_iovlen = msghdr->msg_iovlen; - } - - err = recv_iov(desc, msg, flags); - if (err) - goto err_free_control; - - if (flags & MSG_USER) { kfree(msg->msg_control); msghdr->msg_flags = msg->msg_flags; @@ -353,6 +335,9 @@ int recv_msghdr(struct rpc_desc* desc, err_free_control: kfree(msg->msg_control); +err_free_iov: + if (!(flags & MSG_USER)) + free_iov(msg->msg_iov, msg->msg_iovlen); err_free_name: if (!(flags & MSG_USER)) kfree(msg->msg_name); @@ -367,5 +352,5 @@ void free_msghdr(struct msghdr *msghdr) kfree(msghdr->msg_name); kfree(msghdr->msg_control); - free_iov(msghdr); + free_iov(msghdr->msg_iov, msghdr->msg_iovlen); } diff --git a/kerrighed/fs/faf/faf_tools.h b/kerrighed/fs/faf/faf_tools.h index 2a4a650..e0650d0 100644 --- a/kerrighed/fs/faf/faf_tools.h +++ b/kerrighed/fs/faf/faf_tools.h @@ -12,9 +12,15 @@ enum { MSG_HDR_ONLY = 2, }; +int +send_iov(struct rpc_desc *desc, struct iovec *iov, int iovcnt, size_t total_len, int flags); +int recv_iov(struct rpc_desc *desc, struct iovec *iov, int iovcnt, size_t total_len, int flags); +int alloc_iov(struct iovec **iov, int *iovcnt, size_t total_len); +void free_iov(struct iovec *iov, int iovcnt); + int send_msghdr(struct rpc_desc *desc, struct msghdr *msghdr, - int total_len, int flags); -int recv_msghdr(struct rpc_desc *desc, struct msghdr *msghdr, int flags); + size_t total_len, int flags); +int recv_msghdr(struct rpc_desc *desc, struct msghdr *msghdr, size_t total_len, int flags); void free_msghdr(struct msghdr *msghdr); #endif // __FAF_TOOLS__ commit 34890efc5217eb6df6fb5b1c6674ebdac68b70d8 Author: Louis Rilling <lou...@ke...> Date: Wed Dec 2 12:10:15 2009 +0100 [BUILD] krghotplug: Remove pointless CONFIG_KRG_HOTPLUG_ADD It's only use in the code is wrong, and Kerrighed cannot run without the ability to add nodes. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig index 00463b3..03b7058 100644 --- a/arch/x86/configs/i386_defconfig +++ b/arch/x86/configs/i386_defconfig @@ -771,7 +771,6 @@ CONFIG_KRG_TOOLS=y CONFIG_KRG_COMMUNICATION_FRAMEWORK=y CONFIG_KRG_AUTONODEID=y CONFIG_KRG_HOTPLUG=y -# CONFIG_KRG_HOTPLUG_ADD is not set # CONFIG_KRG_HOTPLUG_DEL is not set # CONFIG_KRG_HOTPLUG_XCH is not set # CONFIG_KRG_DISABLE_HEARTBEAT is not set diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig index 22b4266..8f3ca26 100644 --- a/arch/x86/configs/x86_64_defconfig +++ b/arch/x86/configs/x86_64_defconfig @@ -760,7 +760,6 @@ CONFIG_KRG_TOOLS=y CONFIG_KRG_COMMUNICATION_FRAMEWORK=y CONFIG_KRG_AUTONODEID=y CONFIG_KRG_HOTPLUG=y -# CONFIG_KRG_HOTPLUG_ADD is not set # CONFIG_KRG_HOTPLUG_DEL is not set # CONFIG_KRG_HOTPLUG_XCH is not set # CONFIG_KRG_DISABLE_HEARTBEAT is not set diff --git a/kerrighed/Kconfig.Kerrighed b/kerrighed/Kconfig.Kerrighed index 97be113..3aa3774 100644 --- a/kerrighed/Kconfig.Kerrighed +++ b/kerrighed/Kconfig.Kerrighed @@ -66,12 +66,6 @@ config KRG_HOTPLUG help Support for nodes management -config KRG_HOTPLUG_ADD - bool "KerHotplug: Add support" - depends on KRG_HOTPLUG - help - Support node addition - config KRG_HOTPLUG_DEL bool "KerHotplug: removal support" depends on KRG_HOTPLUG diff --git a/kerrighed/hotplug/hotplug.c b/kerrighed/hotplug/hotplug.c index e65655d..21a6f5f 100644 --- a/kerrighed/hotplug/hotplug.c +++ b/kerrighed/hotplug/hotplug.c @@ -47,7 +47,7 @@ int init_hotplug(void) hotplug_hooks_init(); hotplug_add_init(); -#ifdef CONFIG_KRG_HOTPLUG_ADD +#ifdef CONFIG_KRG_HOTPLUG_DEL hotplug_remove_init(); #endif hotplug_failure_init(); commit 30bcaeb033c2719b8440bf5772941a499fc7ad59 Author: Louis Rilling <lou...@ke...> Date: Wed Apr 14 12:21:08 2010 +0200 krgrpc: Provide simple sysfs interface to enable net devices This commit adds sysfs entry /sys/kerrighed/net_devices that userspace must now use to enable Kerrighed's RPC on given net devices. Besides providing a simple interface to select net devices, this allows userspace to complete preliminary setup before making the node show up as being able to be added to a cluster. Fully automatic cluster start is a direct application. To match the previous behavior that, at kernel boot time, enabled all net devices for Kerrighed's RPC, one must do: # echo ALL > /sys/kerrighed/net_devices If NIC drivers modules are loaded at that time too, those NICs will be enabled for Kerrighed's RPC too. To selectively enable net devices (say eth0 and eth1) for Kerrighed's RPC, one must do: # echo eth0 > /sys/kerrighed/net_devices # echo eth1 > /sys/kerrighed/net_devices To disable all net devices for Kerrighed's RPC, the command is: # echo '-ALL' > /sys/kerrighed/net_devices To selectively disable net devices (say eth0) for Kerrighed's RPC, one must do: # echo '-eth0' > /sys/kerrighed/net_devices Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/include/net/krgrpc/rpc.h b/include/net/krgrpc/rpc.h index bc19804..ca00f02 100644 --- a/include/net/krgrpc/rpc.h +++ b/include/net/krgrpc/rpc.h @@ -303,7 +303,10 @@ void rpc_enable(enum rpcid rpcid); void rpc_enable_all(void); void rpc_disable(enum rpcid rpcid); -void rpc_connect(void); +void rpc_enable_alldev(void); +int rpc_enable_dev(const char *name); +void rpc_disable_alldev(void); +int rpc_disable_dev(const char *name); kerrighed_node_t rpc_desc_get_client(struct rpc_desc *desc); diff --git a/kerrighed/hotplug/krginit.c b/kerrighed/hotplug/krginit.c index 1fe330f..e48393c 100644 --- a/kerrighed/hotplug/krginit.c +++ b/kerrighed/hotplug/krginit.c @@ -7,6 +7,7 @@ #include <linux/fs.h> #include <linux/workqueue.h> #include <linux/sysdev.h> +#include <linux/if.h> #include <kerrighed/version.h> #include <kerrighed/types.h> @@ -529,6 +530,47 @@ static ssize_t abi_show(struct kobject *obj, struct kobj_attribute *attr, static struct kobj_attribute kobj_attr_abi = __ATTR_RO(abi); +static ssize_t net_devices_store(struct kobject *obj, + struct kobj_attribute *attr, + const char *page, size_t count) +{ + char buf[IFNAMSIZ + 2]; + char *name; + int err; + + if (sysfs_streq(page, "+ALL") || sysfs_streq(page, "ALL")) { + rpc_enable_alldev(); + return count; + } else if (sysfs_streq(page, "-ALL")) { + rpc_disable_alldev(); + return count; + } + + name = strncpy(buf, page, IFNAMSIZ + 2); + if (buf[IFNAMSIZ + 1]) + return -EINVAL; + name = strstrip(name); + + switch (name[0]) { + case '-': + err = rpc_disable_dev(name + 1); + break; + case '+': + name++; + /* Fallthrough */ + default: + err = rpc_enable_dev(name); + break; + } + if (err) + return err; + + return count; +} + +static struct kobj_attribute kobj_attr_net_devices = + __ATTR(net_devices, 0200, NULL, net_devices_store); + static struct attribute *attrs[] = { &kobj_attr_node_id.attr, &kobj_attr_session_id.attr, @@ -536,6 +578,7 @@ static struct attribute *attrs[] = { &kobj_attr_max_nodes.attr, &kobj_attr_max_subclusters.attr, &kobj_attr_abi.attr, + &kobj_attr_net_devices.attr, NULL }; @@ -594,5 +637,4 @@ void __init kerrighed_init(void){ printk("Kerrighed... loaded!\n"); rpc_enable(CLUSTER_START); - rpc_connect(); } diff --git a/net/krgrpc/comlayer.c b/net/krgrpc/comlayer.c index 0e84ee1..5c87f5f 100644 --- a/net/krgrpc/comlayer.c +++ b/net/krgrpc/comlayer.c @@ -1224,32 +1224,57 @@ void port_wakeup(struct tipc_port *p_ptr){ queue_delayed_work_on(cpuid, krgcom_wq, &engine->delayed_tx_work, 1); } -static -void enable_all_netdev(void){ - struct net_device *netdev; +int comlayer_enable_dev(const char *name) +{ char buf[256]; + int res; - read_lock(&dev_base_lock); - for_each_netdev(&init_net, netdev){ - int res; + printk("Try to enable bearer on %s:", name); - printk("Try to enable bearer on %s:", netdev->name); + snprintf(buf, sizeof(buf), "eth:%s", name); - snprintf(buf, sizeof(buf), "eth:%s", netdev->name); + res = tipc_enable_bearer(buf, tipc_addr(1, 1, 0), TIPC_MEDIA_LINK_PRI); + if (res) + printk("failed\n"); + else + printk("ok\n"); - res = tipc_enable_bearer(buf, tipc_addr(1, 1, 0), TIPC_MEDIA_LINK_PRI); - if (res){ - printk("failed\n"); - }else{ - printk("ok\n"); - } - } - read_unlock(&dev_base_lock); + return res; } void comlayer_enable(void) { - enable_all_netdev(); + struct net_device *netdev; + + read_lock(&dev_base_lock); + for_each_netdev(&init_net, netdev) + comlayer_enable_dev(netdev->name); + read_unlock(&dev_base_lock); +} + +int comlayer_disable_dev(const char *name) +{ + int res; + + printk("Try to disable bearer on %s:", name); + + res = tipc_disable_bearer(name); + if (res) + printk("failed\n"); + else + printk("ok\n"); + + return res; +} + +void comlayer_disable(void) +{ + struct net_device *netdev; + + read_lock(&dev_base_lock); + for_each_netdev(&init_net, netdev) + comlayer_disable_dev(netdev->name); + read_unlock(&dev_base_lock); } void krg_node_reachable(kerrighed_node_t nodeid){ diff --git a/net/krgrpc/rpc.c b/net/krgrpc/rpc.c index 5925028..e605666 100644 --- a/net/krgrpc/rpc.c +++ b/net/krgrpc/rpc.c @@ -208,11 +208,26 @@ void rpc_undef_handler (struct rpc_desc *desc){ printk("service %d not registered\n", desc->rpcid); }; -void rpc_connect(void) +void rpc_enable_alldev(void) { comlayer_enable(); } +int rpc_enable_dev(const char *name) +{ + return comlayer_enable_dev(name); +} + +void rpc_disable_alldev(void) +{ + comlayer_disable(); +} + +int rpc_disable_dev(const char *name) +{ + return comlayer_disable_dev(name); +} + int init_rpc(void) { int i, res; diff --git a/net/krgrpc/rpc_internal.h b/net/krgrpc/rpc_internal.h index a6518e5..46e25ac 100644 --- a/net/krgrpc/rpc_internal.h +++ b/net/krgrpc/rpc_internal.h @@ -181,6 +181,9 @@ int rpc_synchro_lookup(struct rpc_desc* desc); int comlayer_init(void); void comlayer_enable(void); +int comlayer_enable_dev(const char *name); +void comlayer_disable(void); +int comlayer_disable_dev(const char *name); int thread_pool_init(void); int rpclayer_init(void); int rpc_monitor_init(void); commit fed314374b12cdf54db73c2113ef0cbc5bd2b890 Author: Matthieu Fertré <mat...@ke...> Date: Thu Apr 8 10:43:55 2010 +0200 [BUGFIX] restart: fix file usage counter in case of substitution diff --git a/include/kerrighed/regular_file_mgr.h b/include/kerrighed/regular_file_mgr.h index ef914fd..c8cdb0f 100644 --- a/include/kerrighed/regular_file_mgr.h +++ b/include/kerrighed/regular_file_mgr.h @@ -81,9 +81,9 @@ int get_regular_file_krg_desc(struct file *file, void **desc, int *desc_size); int prepare_restart_data_shared_file(struct file *f, - int local_only, void *fdesc, int fdesc_size, - void **returned_data, size_t *data_size); + void **returned_data, size_t *data_size, + bool from_substitution); struct file *reopen_pipe_file_entry_from_krg_desc(struct task_struct *task, void *_desc); diff --git a/kerrighed/epm/application/app_shared.c b/kerrighed/epm/application/app_shared.c index cc1c246..c0eda44 100644 --- a/kerrighed/epm/application/app_shared.c +++ b/kerrighed/epm/application/app_shared.c @@ -1550,8 +1550,9 @@ static int insert_one_substitution_file(struct rb_root *files, if (r) goto err_put_file; - r = prepare_restart_data_shared_file(file, 0, fdesc, fdesc_size, - &cr_file_link, &file_link_size); + r = prepare_restart_data_shared_file(file, fdesc, fdesc_size, + &cr_file_link, &file_link_size, + true); if (r) goto err_free_desc; diff --git a/kerrighed/fs/regular_file_mgr.c b/kerrighed/fs/regular_file_mgr.c index a9eee53..c99ef52 100644 --- a/kerrighed/fs/regular_file_mgr.c +++ b/kerrighed/fs/regular_file_mgr.c @@ -332,6 +332,7 @@ enum cr_file_desc_type { struct cr_file_link { enum cr_file_desc_type desc_type; + bool from_substitution; unsigned long dvfs_objid; void *desc; }; @@ -680,6 +681,7 @@ static int prepare_restart_data_unsupported_file(void **returned_data, file_link->desc_type = CR_FILE_NONE; file_link->desc = NULL; + file_link->from_substitution = false; *returned_data = file_link; @@ -699,6 +701,7 @@ static int prepare_restart_data_local_file(struct file *f, file_link->desc_type = CR_FILE_POINTER; file_link->desc = f; + file_link->from_substitution = false; *returned_data = file_link; @@ -721,6 +724,7 @@ static int prepare_restart_data_dvfs_file(struct file *f, file_link->desc = &file_link[1]; file_link->desc_type = CR_FILE_REGULAR_DESC; file_link->dvfs_objid = f->f_objid; + file_link->from_substitution = false; memcpy(file_link->desc, desc, desc_size); *returned_data = file_link; @@ -745,6 +749,7 @@ static int prepare_restart_data_faf_file(struct file *f, file_link->desc = &file_link[1]; file_link->desc_type = CR_FILE_FAF_DESC; file_link->dvfs_objid = f->f_objid; + file_link->from_substitution = false; if (f->f_flags & O_FAF_SRV) fill_faf_file_krg_desc(file_link->desc, f); @@ -761,31 +766,57 @@ static int prepare_restart_data_faf_file(struct file *f, #endif int prepare_restart_data_shared_file(struct file *f, - int local_only, void *fdesc, int fdesc_size, - void **returned_data, size_t *data_size) + void **returned_data, size_t *data_size, + bool from_substitution) +{ + int r; + struct cr_file_link *file_link; + +#ifdef CONFIG_KRG_FAF + if (f->f_flags & (O_FAF_CLT | O_FAF_SRV)) + r = prepare_restart_data_faf_file(f, returned_data, + data_size); + else +#endif + r = prepare_restart_data_dvfs_file(f, fdesc, fdesc_size, + returned_data, + data_size); + + if (r) + goto error; + + file_link = (struct cr_file_link *)(*returned_data); + file_link->from_substitution = from_substitution; +error: + return r; +} + + +static int prepare_restart_data_supported_file( + struct file *f, int local_only, + void *fdesc, int fdesc_size, + void **returned_data, size_t *data_size) { int r; if (!local_only) { - /* get a new dvfs objid */ - r = create_kddm_file_object(f); - if (r) - goto error; + + if (!f->f_objid) { + /* get a new dvfs objid */ + r = create_kddm_file_object(f); + if (r) + goto error; + } #ifdef CONFIG_KRG_FAF r = setup_faf_file_if_needed(f); if (r) goto error; - - if (f->f_flags & (O_FAF_CLT | O_FAF_SRV)) - r = prepare_restart_data_faf_file(f, returned_data, - data_size); - else #endif - r = prepare_restart_data_dvfs_file(f, fdesc, fdesc_size, - returned_data, - data_size); + r = prepare_restart_data_shared_file(f, fdesc, fdesc_size, + returned_data, data_size, + false); } else r = prepare_restart_data_local_file(f, returned_data, data_size); @@ -833,8 +864,8 @@ static int cr_import_now_file(struct epm_action *action, if (r) goto err_free_desc; - r = prepare_restart_data_shared_file(f, local_only, desc, desc_size, - returned_data, data_size); + r = prepare_restart_data_supported_file(f, local_only, desc, desc_size, + returned_data, data_size); err_free_desc: kfree(desc); @@ -851,7 +882,8 @@ static int cr_import_complete_file(struct task_struct *fake, void *_file_link) struct cr_file_link *file_link = _file_link; struct file *file; - if (file_link->desc_type == CR_FILE_NONE) + if (file_link->desc_type == CR_FILE_NONE + || file_link->from_substitution) /* the file has not been imported */ return 0; @@ -883,7 +915,8 @@ static int cr_delete_file(struct task_struct *fake, void *_file_link) struct cr_file_link *file_link = _file_link; struct file *file; - if (file_link->desc_type == CR_FILE_NONE) + if (file_link->desc_type == CR_FILE_NONE + || file_link->from_substitution) /* the file has not been imported */ return 0; commit 8385be238759fd7b354c06de128f691910102a0d Author: Renaud Lottiaux <Ren...@ke...> Date: Tue Apr 13 16:21:51 2010 +0200 [BUGFIX] Fix sleep with spinlock held in export_files_struct. diff --git a/kerrighed/fs/mobility.c b/kerrighed/fs/mobility.c index 4dca58f..a2c84c1 100644 --- a/kerrighed/fs/mobility.c +++ b/kerrighed/fs/mobility.c @@ -621,6 +621,7 @@ int export_files_struct (struct epm_action *action, int r = 0, export_fdt; int last_open_fd; struct fdtable *fdt; + struct files_struct *exported_files; BUG_ON (!tsk); @@ -641,34 +642,37 @@ int export_files_struct (struct epm_action *action, /* Export the main files structure */ - r = ghost_write (ghost, tsk->files, sizeof (struct files_struct)); - if (r) + exported_files = dup_fd (tsk->files, &r); + if (!exported_files) goto err; + r = ghost_write (ghost, exported_files, sizeof (struct files_struct)); + if (r) + goto exit_put_files; + /* Export the bit vector close_on_exec */ - spin_lock(&tsk->files->file_lock); - fdt = files_fdtable(tsk->files); + fdt = files_fdtable(exported_files); last_open_fd = count_open_files(fdt); r = ghost_write (ghost, &last_open_fd, sizeof (int)); if (r) - goto exit_unlock; + goto exit_put_files; - export_fdt = (fdt != &tsk->files->fdtab); + export_fdt = (fdt != &exported_files->fdtab); r = ghost_write (ghost, &export_fdt, sizeof (int)); if (r) - goto exit_unlock; + goto exit_put_files; if (export_fdt) { int nr = last_open_fd / BITS_PER_BYTE; r = ghost_write (ghost, fdt->close_on_exec, nr); if (r) - goto exit_unlock; + goto exit_put_files; r = ghost_write (ghost, fdt->open_fds, nr); if (r) - goto exit_unlock; + goto exit_put_files; } @@ -677,7 +681,7 @@ int export_files_struct (struct epm_action *action, r = ghost_write (ghost, &magic, sizeof (int)); if (r) - goto exit_unlock; + goto exit_put_files; } if (action->type == EPM_CHECKPOINT) { @@ -687,7 +691,7 @@ int export_files_struct (struct epm_action *action, r = export_open_files (action, ghost, tsk, fdt, last_open_fd); if (r) - goto exit_unlock; + goto exit_put_files; { int magic = 380574; @@ -695,8 +699,8 @@ int export_files_struct (struct epm_action *action, r = ghost_write (ghost, &magic, sizeof (int)); } -exit_unlock: - spin_unlock(&tsk->files->file_lock); +exit_put_files: + put_files_struct (exported_files); err: return r; @@ -1140,6 +1144,7 @@ int import_files_struct (struct epm_action *action, BUG_ON (!r && magic != 380574); } + return 0; exit_free_fdt: commit d91a195aec34ea662a90616d20a0207151cb6604 Author: Renaud Lottiaux <Ren...@ke...> Date: Tue Apr 13 16:21:46 2010 +0200 [BUGFIX] Fix wrong computation of object id in try_to_flush_one. diff --git a/kerrighed/mm/injection.c b/kerrighed/mm/injection.c index 9378530..e316a0d 100644 --- a/kerrighed/mm/injection.c +++ b/kerrighed/mm/injection.c @@ -263,7 +263,7 @@ static int try_to_flush_one(struct page *page, struct vm_area_struct *vma) objid = page->index; if (vma->vm_file) - objid += vma->vm_start; + objid += (vma->vm_start >> PAGE_SHIFT) - vma->vm_pgoff; address = objid * PAGE_SIZE; commit 3f0a474f830c3a11352746d604f0e7b3fbf09c64 Author: Matthieu Fertré <mat...@ke...> Date: Tue Mar 30 09:27:24 2010 +0200 C/R: support processes attached to posix shm. POSIX shared memory segment uses the shmem_vm_ops. diff --git a/include/kerrighed/krgsyms.h b/include/kerrighed/krgsyms.h index d5ba99c..f7beebf 100644 --- a/include/kerrighed/krgsyms.h +++ b/include/kerrighed/krgsyms.h @@ -7,6 +7,7 @@ typedef enum krgsyms_val { KRGSYMS_UNDEF, // Must be the first one KRGSYMS_VM_OPS_NULL, KRGSYMS_VM_OPS_SHM, + KRGSYMS_VM_OPS_SHMEM, KRGSYMS_VM_OPS_FILE_GENERIC, KRGSYMS_VM_OPS_NFS_FILE, KRGSYMS_VM_OPS_OCFS2_FILE, diff --git a/kerrighed/mm/mobility.c b/kerrighed/mm/mobility.c index 2d89b23..20112e3 100644 --- a/kerrighed/mm/mobility.c +++ b/kerrighed/mm/mobility.c @@ -401,6 +401,12 @@ static int export_one_vma (struct epm_action *action, vm_ops_type = krgsyms_export (vma->vm_ops); if (vma->vm_ops && vm_ops_type == KRGSYMS_UNDEF) goto out; + + /* shmem_vm_ops (posix shm) is supported only for checkpoint/restart */ + if (action->type != EPM_CHECKPOINT + && vma->vm_ops && vm_ops_type == KRGSYMS_VM_OPS_SHMEM) + goto out; + initial_vm_ops_type = krgsyms_export (vma->initial_vm_ops); if (vma->initial_vm_ops && initial_vm_ops_type == KRGSYMS_UNDEF) goto out; diff --git a/mm/shmem.c b/mm/shmem.c index b25f95c..8ce68b7 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -65,6 +65,10 @@ static struct vfsmount *shm_mnt; #include <asm/div64.h> #include <asm/pgtable.h> +#ifdef CONFIG_KRG_EPM +#include <kerrighed/krgsyms.h> +#endif + /* * The maximum size of a shmem/tmpfs file is limited by the maximum size of * its triple-indirect swap vector - see illustration at shmem_swp_entry(). @@ -2541,6 +2545,14 @@ static int __init init_tmpfs(void) goto out2; } +#ifdef CONFIG_KRG_EPM + error = krgsyms_register(KRGSYMS_VM_OPS_SHMEM, &shmem_vm_ops); + if (error) { + printk(KERN_ERR "Could not register shmem_vm_ops\n"); + goto out1_1; + } +#endif + shm_mnt = vfs_kern_mount(&tmpfs_fs_type, MS_NOUSER, tmpfs_fs_type.name, NULL); if (IS_ERR(shm_mnt)) { @@ -2551,6 +2563,10 @@ static int __init init_tmpfs(void) return 0; out1: +#ifdef CONFIG_KRG_EPM + krgsyms_unregister(KRGSYMS_VM_OPS_SHMEM); +out1_1: +#endif unregister_filesystem(&tmpfs_fs_type); out2: destroy_inodecache(); commit 4fc41538267d5d826a8a0da5aaaf9dc26b86088d Author: Matthieu Fertré <mat...@ke...> Date: Mon Mar 29 17:08:45 2010 +0200 [BUGFIX] checkpoint: remove abusive BUG() A previous checkpoint may have failed and we want to try again with some other options (for instance to ignore unsupported file). diff --git a/kerrighed/epm/application/app_checkpoint.c b/kerrighed/epm/application/app_checkpoint.c index cf83053..7ae6eb4 100644 --- a/kerrighed/epm/application/app_checkpoint.c +++ b/kerrighed/epm/application/app_checkpoint.c @@ -354,11 +354,6 @@ static inline int __local_do_chkpt(struct app_struct *app, int chkpt_sn) list_for_each_entry(tsk, &app->tasks, next_task) { tmp = tsk->task; - if (tsk->result != PCUS_OPERATION_OK) { - printk("Pid: %d, result: %d\n", tmp->pid, tsk->result); - BUG(); - } - tsk->result = PCUS_CHKPT_IN_PROGRESS; BUG_ON(tmp == current); __chkpt_task_req(app, tsk); commit 921b611972f403d0cde246cf985123c31886f5e8 Author: Louis Rilling <lou...@ke...> Date: Mon Mar 29 18:27:59 2010 +0200 [BUGFIX] krgfaf: Make the FAF server use the security context of the client Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/... [truncated message content] |
From: alebre <al...@us...> - 2010-05-03 11:38:51
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "kdfs". The branch, make_kdfs_compile has been updated via 5a3bf8826dd301491d29a753c4b833ff46f1458e (commit) from eeac43c259fa29f8f8595c6657e23c1fe3e291ea (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 5a3bf8826dd301491d29a753c4b833ff46f1458e Author: ad <leb...@fr...> Date: Mon May 3 13:38:15 2010 +0000 [MINOR] some forgot fixes diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index c98e8b2..8480f36 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -615,11 +615,7 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, /* First_Touch has to be called only on the node currently in charge */ /* of the page. */ - // TODO NOW - Adrine - // Commented till directory management is not correctly - // striped (dir.c still continues to call kdfs_grap_page - // instead of kdfs_distgrab/get.... - // BUG_ON(kerrighed_node_id != page_linked_node(objid)); + BUG_ON(kerrighed_node_id != page_linked_node(objid)); /* Allocate kdfs_page and retrieve page address */ k_page = kmalloc(sizeof(struct kdfs_page), GFP_KERNEL); @@ -658,6 +654,7 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, kunmap(k_page->page); + // TODO NOW - Adrien, check why this message occurs each time ? if (!IS_ERR(k_page->page)) DEBUG(DBG_ALERT, "Can't read page for file/directory = %ld and page id = %ld\n", iolinker_data->ino, contentobjid_to_pageindex(objid)); diff --git a/fs/kdfs/debug_kdfs.h b/fs/kdfs/debug_kdfs.h index f9a4785..d5b7777 100644 --- a/fs/kdfs/debug_kdfs.h +++ b/fs/kdfs/debug_kdfs.h @@ -29,7 +29,7 @@ #define DBG_TRACE 3 #define DBG_INFO 4 -#define KDFS_DEBUG_LEVEL 4 +#define KDFS_DEBUG_LEVEL 1 #ifdef DEBUG #undef DEBUG diff --git a/fs/kdfs/dir.c b/fs/kdfs/dir.c index 6eb9439..5a0f3b4 100644 --- a/fs/kdfs/dir.c +++ b/fs/kdfs/dir.c @@ -9,6 +9,7 @@ * @maintainer Adrien Lebre * * Copyright (C) 2006-2007, XtreemOS Consortium. + * Copyright (C) 2008-20xx, Mines Nantes - INRIA Rennes Bretagne Atlantique - LINA . */ #include <linux/buffer_head.h> @@ -77,7 +78,8 @@ struct kdfs_dir_entry *kdfs_grab_entry (struct kdfs_inode *dir, const char *file /* Parse directory dentries */ DEBUG (DBG_INFO, "Start to look inside directory\n"); do { - *k_page = kdfs_grab_page(dir->content_setid, pageid); + // *k_page = kdfs_grab_page(dir->content_setid, pageid); + *k_page = kdfs_grab_distpage(dir, pageid); if (IS_ERR(*k_page)) DEBUG (DBG_PANIC, "Can't grab page %ld for the directory %ld", @@ -181,7 +183,8 @@ struct kdfs_dir_entry *kdfs_find_entry(struct kdfs_inode *dir, DEBUG (DBG_INFO, "Start to look inside directory \n"); do { - *k_page = kdfs_get_page(dir->content_setid, pageid); + //*k_page = kdfs_get_page(dir->content_setid, pageid); + *k_page = kdfs_get_distpage(dir,pageid); if (IS_ERR(*k_page)) DEBUG(DBG_PANIC, "Can't get page %ld for the directory %ld\n", @@ -401,7 +404,8 @@ int kdfs_add_dir_entry(struct kdfs_inode *kdfs_pdir, char *filename, ino_t ino, } // TODO PRIORITY 1: Test grab reception - kdfs_page = kdfs_grab_page(kdfs_pdir->content_setid, pageid); +// kdfs_page = kdfs_grab_page(kdfs_pdir->content_setid, pageid); + kdfs_page = kdfs_grab_distpage(kdfs_pdir, pageid); ASSERT(kdfs_page != NULL); DEBUG(DBG_INFO, "Page Grabbed, gonna add an entry at pageid %ld offset %ld\n", pageid, offset); @@ -501,7 +505,8 @@ int kdfs_del_dir_entry(struct kdfs_inode *kdfs_pdir, char *filename, ino_t ino) offset = (kdfs_pdir->inode->i_size - KDFS_DIRENT_SIZE) % PAGE_SIZE; if (last_pageid != k_page->obj_id) { - klast_page = kdfs_get_page(kdfs_pdir->content_setid, last_pageid); + // klast_page = kdfs_get_page(kdfs_pdir->content_setid, last_pageid); + klast_page = kdfs_get_distpage(kdfs_pdir, last_pageid); last_page_addr = kmap_atomic(klast_page->page, KM_USER1); } else last_page_addr = page_addr; @@ -678,7 +683,8 @@ int kdfs_readdir(struct file *filp, void *dirent, filldir_t filldir) pageoffset = filp->f_pos - (pageid * PAGE_SIZE); npages = (k_inode->inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; do { - k_page = kdfs_get_page(k_inode->content_setid, pageid); + // k_page = kdfs_get_page(k_inode->content_setid, pageid); + k_page = kdfs_get_distpage(k_inode, pageid); if (IS_ERR(k_page)) DEBUG(DBG_PANIC, ----------------------------------------------------------------------- Summary of changes: fs/kdfs/address_space.c | 7 ++----- fs/kdfs/debug_kdfs.h | 2 +- fs/kdfs/dir.c | 16 +++++++++++----- 3 files changed, 14 insertions(+), 11 deletions(-) hooks/post-receive -- kdfs |
From: alebre <al...@us...> - 2010-04-08 22:22:23
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "kdfs". The branch, make_kdfs_compile has been updated via eeac43c259fa29f8f8595c6657e23c1fe3e291ea (commit) via 149616b9bad210b6fbbc37d44d9201ef01cd9fb7 (commit) from f2224460b8a9dc2773dab44caf9df1c1450b273e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit eeac43c259fa29f8f8595c6657e23c1fe3e291ea Author: ad <leb...@fr...> Date: Tue Apr 6 19:44:03 2010 +0000 [FIX] kdfs_get_distpage led to some crashes when the page was new and that no extent was assigned for this page diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index 996f92f..c98e8b2 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -316,6 +316,13 @@ struct kdfs_page *kdfs_get_distpage(struct kdfs_inode *k_inode, pgoff_t page_id objid_t objid ; masternode = kdfs_file_extent_get_page_owner(k_inode, page_id); + if(masternode == KDFS_NONE_NODEID) { + // The page is new. Since this is a read, we do not really have to assign the page + // to the current node id but we do :(TODO - fix the strange assignement and try to handle diskless approach case) + masternode = kerrighed_node_id ; + kdfs_file_extent_set_page_owner(k_inode, page_id, masternode); + } + objid = pageindex_to_contentobjid(masternode, page_id); DEBUG(DBG_INFO, "Get page %ld (masternode %d, objid %ld from set %ld)\n", page_id, masternode, objid, k_inode->content_setid); commit 149616b9bad210b6fbbc37d44d9201ef01cd9fb7 Author: ad <leb...@fr...> Date: Tue Apr 6 19:21:27 2010 +0000 [SANITY CHECKS] kdfs_distget_page can lead to some crashes, add bug_on at the first sight diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index 88c3a49..996f92f 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -312,11 +312,17 @@ struct address_space_operations kdfs_aops = { // I did that just to be faster, will improve that later if the code runs ;) struct kdfs_page *kdfs_get_distpage(struct kdfs_inode *k_inode, pgoff_t page_id){ struct kdfs_page *k_page; - DEBUG(DBG_INFO, "Get page %ld from set %ld\n", page_id, k_inode->content_setid); - k_page =kdfs_get_page(k_inode->content_setid, - pageindex_to_contentobjid( - kdfs_file_extent_get_page_owner(k_inode, page_id),page_id)); - return k_page; + kdfs_node_t masternode ; + objid_t objid ; + + masternode = kdfs_file_extent_get_page_owner(k_inode, page_id); + objid = pageindex_to_contentobjid(masternode, page_id); + + DEBUG(DBG_INFO, "Get page %ld (masternode %d, objid %ld from set %ld)\n", page_id, masternode, objid, k_inode->content_setid); + BUG_ON(objid == -1); + + k_page =kdfs_get_page(k_inode->content_setid,objid); + return k_page; } ----------------------------------------------------------------------- Summary of changes: fs/kdfs/address_space.c | 23 ++++++++++++++++++----- 1 files changed, 18 insertions(+), 5 deletions(-) hooks/post-receive -- kdfs |
From: alebre <al...@us...> - 2010-04-08 21:37:09
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "kdfs". The branch, make_kdfs_compile has been updated via f2224460b8a9dc2773dab44caf9df1c1450b273e (commit) from 15a599ff9119ab06b14d3d6544c6f5fc9061ea65 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f2224460b8a9dc2773dab44caf9df1c1450b273e Author: ad <leb...@fr...> Date: Tue Apr 6 18:58:25 2010 +0000 [FIX] few fixes concerning the sharing page issue occuring when the master in charge of a k_page was changed (kdfs_distrgrab...) diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index aed2e77..88c3a49 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -257,6 +257,7 @@ void kdfs_invalidatepage(struct page *page, unsigned long offset) k_page = (struct kdfs_page *) page->private; if (offset == 0) { /* The whole page is invalidated so it should be removed */ + DEBUG(DBG_INFO, "Gonna remove page %ld (objid %ld from set %ld)\n", page->index, k_page->obj_id,k_page->set_id); kddm_remove_object(kddm_def_ns, k_page->set_id, k_page->obj_id); ClearPagePrivate(page); } @@ -354,8 +355,12 @@ struct kdfs_page *kdfs_grab_distpage(struct kdfs_inode *k_inode, pgoff_t page_id k_newpage=kdfs_grab_page(k_inode->content_setid, objid); if(k_prevpage){ + // TODO BUG set the reference to the local page to NULL, otherwise, k_prepage can still refer to the page managed by the + // kdfs k_newpage. + k_prevpage->page=NULL; _kdfs_put_page(k_prevpage); // TODO Now - Adrien : destroy the k_prevpage (memory leak) + } return k_newpage; @@ -586,15 +591,22 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, pgoff_t pageid; iolinker_data = (struct content_iolinker_data *) set->private_data; - // First_Touch has to be called only on the node currently in charge of the page - BUG_ON(kerrighed_node_id != page_linked_node(objid)); - pageid = contentobjid_to_pageindex(objid); + pageid = contentobjid_to_pageindex(objid); + /* WARNING: quite ugly, we should not access to a local inode without locking the corresponding kddm object*/ /* What do you mean : locking the physical file, what kddm object ? the inode one ? */ k_mapping = ((struct content_iolinker_data *) set->private_data)->k_mapping; BUG_ON(k_mapping == NULL); DEBUG(DBG_TRACE, "file/directory = %ld, pageid = %ld, objid = %ld, @mapping = %p\n", iolinker_data->ino,pageid, objid, k_mapping); + + /* First_Touch has to be called only on the node currently in charge */ + /* of the page. */ + // TODO NOW - Adrine + // Commented till directory management is not correctly + // striped (dir.c still continues to call kdfs_grap_page + // instead of kdfs_distgrab/get.... + // BUG_ON(kerrighed_node_id != page_linked_node(objid)); /* Allocate kdfs_page and retrieve page address */ k_page = kmalloc(sizeof(struct kdfs_page), GFP_KERNEL); @@ -615,16 +627,22 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, pageid); k_page->page = find_or_create_page(k_mapping, pageid, (mapping_gfp_mask(k_mapping)|__GFP_ZERO) & ~__GFP_FS); k_page->flags = K_PG_locked; + + page_addr = (char *) kmap(k_page->page); + pos = (loff_t)pageid * PAGE_SIZE; + + /* The page should be filled only if it was not handled + * by another node before (i.e if the page is already in + * the cache, it means that the page has been inserted + * throught another kddm object call) + */ + iolinker_data->content_readphyspage(iolinker_data, page_addr, pos); + } else k_page->flags = K_PG_ok; DEBUG(DBG_TRACE, "After find Page count=%d\n", page_count(k_page->page)); - page_addr = (char *) kmap(k_page->page); - pos = (loff_t)pageid * PAGE_SIZE; - - iolinker_data->content_readphyspage(iolinker_data, page_addr, pos); - kunmap(k_page->page); if (!IS_ERR(k_page->page)) @@ -850,8 +868,6 @@ int kdfs_iol_page_put(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid) ASSERT(objEntry != NULL); k_page = (struct kdfs_page *)objEntry->object; - DEBUG(DBG_ALERT, "Page count = %d\n", page_count(k_page->page)); - //page_cache_release(k_page->page); PRINT_FUNCTION_EXIT; ----------------------------------------------------------------------- Summary of changes: fs/kdfs/address_space.c | 36 ++++++++++++++++++++++++++---------- 1 files changed, 26 insertions(+), 10 deletions(-) hooks/post-receive -- kdfs |
From: alebre <al...@us...> - 2010-04-02 23:37:35
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "kdfs". The branch, make_kdfs_compile has been updated via 15a599ff9119ab06b14d3d6544c6f5fc9061ea65 (commit) from 287b2cc707a91d25ddf4888daa06170b9c4c9aa5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 15a599ff9119ab06b14d3d6544c6f5fc9061ea65 Author: ad <leb...@fr...> Date: Sat Apr 3 01:35:07 2010 +0000 [MINOR] objectid vs pageid manipulations [JANITORING] Start to check/valid content I/O linker diff --git a/fs/kdfs/README b/fs/kdfs/README index 83a9b7c..1a20771 100644 --- a/fs/kdfs/README +++ b/fs/kdfs/README @@ -145,5 +145,5 @@ INODE MANAGEMENT: CONTENT MANAGEMENT (DIR AND PAGES): - - - - - - - - - - - - - - - - - - +kDFS has been implemented keeping in mind that all writes should be perform locally. +Since the implementation of the striping policies, objid does not correspond to pageid. diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index 983588a..aed2e77 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -508,20 +508,20 @@ int __local_destroy_content_kddm_set(struct kdfs_inode *k_inode) /*****************************************************************************/ /* */ -/* ADDRESS IO LINKER PART */ -/* (exploited for dir and file io-linkers) */ -/* */ +/* ADDRESS IO LINKER PART */ +/* (exploited for dir and file io-linkers) */ +/* (Latest code verification - April, 2010 - Adrien) */ /*****************************************************************************/ /* - * Allocate a kdfs_page object + * Allocate a kdfs_page object * @author Adrien Lebre * * @param objEntry Kddm page descriptor. * @param set Kddm descriptor * @param objid Id of the page to create. * - * @return the new allocated kdfs_page. NULL otherwise. + * @return 0 */ int kdfs_iol_page_alloc(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid) { @@ -536,8 +536,8 @@ int kdfs_iol_page_alloc(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid) k_page = kmalloc(sizeof(struct kdfs_page), GFP_KERNEL); ASSERT(k_page); - DEBUG(DBG_INFO, "Before Alloc new page %ld from set %lu \n", objid, set->id); - k_page->page = find_get_page(k_mapping, objid); + DEBUG(DBG_INFO, "Before Alloc objid %ld from set %lu (page id %ld)\n", objid, set->id, contentobjid_to_pageindex(objid)); + k_page->page = find_get_page(k_mapping, contentobjid_to_pageindex(objid)); if (!k_page->page) { DEBUG(DBG_ALERT, "Can't find page for file/directory = %ld and page id = %ld, So created and locked\n", @@ -562,19 +562,19 @@ int kdfs_iol_page_alloc(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid) } /* - * Handle a kdfs page first touch + * Handle a kdfs page first touch * @author Adrien Lebre * - * @param objEntry Kddm page descriptor. - * @param set Kddm descriptor - * @param objid Id of the page to create. - * @param flags Creation flag (useless in that case) + * @param objEntry Kddm object descriptor. + * @param set Kddm set descriptor + * @param objid Id of the object to create. + * @param flags Creation flag (useless in that case) * * @return 0 if everything is ok. Negative value otherwise. */ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, - kddm_set_t *set, - objid_t objid, int flags) + kddm_set_t *set, + objid_t objid, int flags) { struct address_space *k_mapping; @@ -583,82 +583,83 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, char *page_addr = NULL; loff_t pos; int res = 0; + pgoff_t pageid; iolinker_data = (struct content_iolinker_data *) set->private_data; - - DEBUG(DBG_TRACE, "file/directory = %ld, pageid = %ld (objid = %ld)\n", iolinker_data->ino, contentobjid_to_pageindex(kerrighed_node_id,objid), objid); + // First_Touch has to be called only on the node currently in charge of the page + BUG_ON(kerrighed_node_id != page_linked_node(objid)); + pageid = contentobjid_to_pageindex(objid); /* WARNING: quite ugly, we should not access to a local inode without locking the corresponding kddm object*/ + /* What do you mean : locking the physical file, what kddm object ? the inode one ? */ k_mapping = ((struct content_iolinker_data *) set->private_data)->k_mapping; - ASSERT(k_mapping); - DEBUG(DBG_TRACE, "file/directory = %ld, pageid = %ld mapping = %p\n", iolinker_data->ino,contentobjid_to_pageindex(kerrighed_node_id, objid), k_mapping); + BUG_ON(k_mapping == NULL); + DEBUG(DBG_TRACE, "file/directory = %ld, pageid = %ld, objid = %ld, @mapping = %p\n", iolinker_data->ino,pageid, objid, k_mapping); /* Allocate kdfs_page and retrieve page address */ k_page = kmalloc(sizeof(struct kdfs_page), GFP_KERNEL); - ASSERT(k_page != NULL); + BUG_ON(k_page == NULL); k_page->set_id = set->id; k_page->obj_id = objid; /* By default, the whole page is useful */ k_page->offset = 0; k_page->to = PAGE_SIZE; - k_page->page = NULL; - - ASSERT(k_mapping != NULL); - + /* The page can be already in the cache, especially when we dynamically change the default owner */ - k_page->page = find_get_page(k_mapping, contentobjid_to_pageindex(kerrighed_node_id,objid)); + k_page->page = find_get_page(k_mapping, pageid); if (!k_page->page) { - DEBUG(DBG_ALERT, "Can't find page for file/directory = %ld and page id = %ld, So created and locked\n", iolinker_data->ino, contentobjid_to_pageindex(kerrighed_node_id, objid)); - k_page->page = find_or_create_page(k_mapping, objid, (mapping_gfp_mask(k_mapping)|__GFP_ZERO) & ~__GFP_FS); + DEBUG(DBG_TRACE, "Can't find page for file/directory = %ld and " \ + "page id = %ld, So created and locked\n", iolinker_data->ino, + pageid); + k_page->page = find_or_create_page(k_mapping, pageid, (mapping_gfp_mask(k_mapping)|__GFP_ZERO) & ~__GFP_FS); k_page->flags = K_PG_locked; } else k_page->flags = K_PG_ok; - DEBUG(DBG_ALERT, "After find Page count=%d\n", page_count(k_page->page)); + DEBUG(DBG_TRACE, "After find Page count=%d\n", page_count(k_page->page)); page_addr = (char *) kmap(k_page->page); - pos = (loff_t)contentobjid_to_pageindex(kerrighed_node_id, objid) * PAGE_SIZE; + pos = (loff_t)pageid * PAGE_SIZE; iolinker_data->content_readphyspage(iolinker_data, page_addr, pos); kunmap(k_page->page); if (!IS_ERR(k_page->page)) - DEBUG(DBG_ALERT, "Can't read page for file/directory = %ld and page id = %ld\n", iolinker_data->ino, contentobjid_to_pageindex(kerrighed_node_id, objid)); + DEBUG(DBG_ALERT, "Can't read page for file/directory = %ld and page id = %ld\n", iolinker_data->ino, contentobjid_to_pageindex(objid)); objEntry->object = (void *) k_page; - /* TODO PRIORITY 2: should release in kdfs_put_page instead? */ - //page_cache_release(k_page->page); - - DEBUG(DBG_ALERT, "After read Page count=%d\n", page_count(k_page->page)); - + // Note: the page has not been release, this action should be perform + // in the insert or export function according the kddm operation (get or grab) PRINT_FUNCTION_EXIT; return res; } /* - * Receive a fresh copy of kdfs_page. + * Receive a fresh copy of kdfs_page. * @author Adrien Lebre * - * @param objEntry Descriptor of the page to insert. - * @param ctnr Container descriptor - * @param padeid Id of the page to insert. + * @param objEntry Descriptor to the object to insert. + * @param set KDDM set descriptor + * @param objid Id of the object to insert. */ int kdfs_iol_page_insert(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid) { - struct kdfs_page *k_page; + struct kdfs_page *k_page; + PRINT_FUNCTION_NAME; k_page = (struct kdfs_page *) objEntry->object; - DEBUG(DBG_ALERT, "Entering page count=%d\n", page_count(k_page->page)); + DEBUG(DBG_TRACE, "Entering page count=%d\n", page_count(k_page->page)); /* * Set the private field of the page to get callback when it is - * released from local cache. + * released from local cache (cf. kdfs_invalidatepage or kdfs_releasepage) */ + SetPagePrivate(k_page->page); set_page_private(k_page->page, (unsigned long) k_page); @@ -672,28 +673,32 @@ int kdfs_iol_page_insert(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid) } page_cache_release(k_page->page); - DEBUG(DBG_ALERT, "Exiting page count=%d\n", page_count(k_page->page)); + DEBUG(DBG_TRACE, "Exiting page count=%d\n", page_count(k_page->page)); + PRINT_FUNCTION_EXIT; return 0; } /* - * Export an object + * Export an object * @author Adrien Lebre * - * @param desc Network descriptor exploited by rpc_pack() - * @param objEntry The object to export data from. - * @param objid Object id of the object + * @param desc Network descriptor exploited by rpc_pack() + * @param set Kddm set descriptor + * @param objEntry The object to export data from. + * @param objid Object id of the object + * @param flags kddm specific values (TODO clarify) */ int kdfs_iol_page_export (struct rpc_desc *desc, - struct kddm_set *set, - struct kddm_obj *objEntry, - objid_t objid, - int flags) + struct kddm_set *set, + struct kddm_obj *objEntry, + objid_t objid, + int flags) { struct kdfs_page *k_page = (struct kdfs_page *)objEntry->object; int res = 0; char *page_addr = NULL; + PRINT_FUNCTION_NAME; page_addr = (char *) kmap_atomic(k_page->page, KM_USER0); @@ -704,43 +709,64 @@ int kdfs_iol_page_export (struct rpc_desc *desc, kunmap_atomic(page_addr, KM_USER0); + if (k_page->flags == K_PG_locked) { /* - * If the page has been created by kDFS, we should unlock the page - * cf. find_or_create() in first touch (in that case : first_touch - * and export functions are the only ones called, insert is bypassed + * if the page is still locked, it means that we are in the case of + * a remote grab: first_touch and export functions are the only ones called, + * insert is bypassed, so the page has not been unlock and released yet. */ - if (k_page->flags == K_PG_locked) { unlock_page(k_page->page); k_page->flags = K_PG_ok; + page_cache_release(k_page->page); } - // TODO ADRIEN NOW: cache_page_release - PRINT_FUNCTION_EXIT; return res; } -int kdfs_iol_page_invalidate(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid) +/* + * Invalidate an object + * @author Adrien Lebre + * + * @param objEntry The object to invalidate + * @param set Kddm set descriptor + * @param objid Object id of the object + * + * @return 0 + */ +int kdfs_iol_page_invalidate(kddm_obj_t *objEntry, kddm_set_t *set, + objid_t objid) { - struct kdfs_page *k_page = (struct kdfs_page *)objEntry->object; + struct kdfs_page *k_page ; + PRINT_FUNCTION_NAME; + k_page=(struct kdfs_page *)objEntry->object; + + /* + * the object to invalidate should concern the right page + */ + BUG_ON(contentobjid_to_pageindex(objid)!=k_page->page->index); + + DEBUG(DBG_INFO, "Try to invalidate objid %ld (page id %ld page addr %p) of set %lu\n", objid, k_page->page->index, k_page->page, set->id); + trylock_page(k_page->page); + // TODO Remove Useless traces DEBUG(DBG_ALERT, "Page count before =%d\n", page_count(k_page->page)); remove_from_page_cache(k_page->page); ClearPagePrivate(k_page->page); unlock_page(k_page->page); page_cache_release(k_page->page); + // TODO Remove Useless traces DEBUG(DBG_ALERT, "Page after count=%d\n", page_count(k_page->page)); - /* - * TODO PRIORITY 2: Adrien - * Page Count should be probably decremented - */ PRINT_FUNCTION_EXIT; + return 0; } +// TODO END OF CODE CHECKING + /* * Import an object * @author Adrien Lebre @@ -794,7 +820,7 @@ int kdfs_iol_page_sync(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid) DEBUG(DBG_INFO, "Try to sync page %ld (page addr %p) of set %lu\n", objid, k_page->page, set->id); - file_pos = ((loff_t)contentobjid_to_pageindex(kerrighed_node_id, objid) * PAGE_SIZE) + k_page->offset; + file_pos = ((loff_t)contentobjid_to_pageindex(objid) * PAGE_SIZE) + k_page->offset; page_addr = (char *) kmap(k_page->page); pos_addr = page_addr + k_page->offset; diff --git a/fs/kdfs/address_space.h b/fs/kdfs/address_space.h index 73e6e01..1a569c7 100644 --- a/fs/kdfs/address_space.h +++ b/fs/kdfs/address_space.h @@ -88,6 +88,7 @@ struct kdfs_page { /* Associated kddm meta-data */ kddm_set_id_t set_id; /* kddm set id */ objid_t obj_id; /* obj_id within kddm set */ +// TODO Now Adrien - the variable is now useless. remove it and fix the import and export functions. #if KDFS_FILE_STRIPING kerrighed_node_t linked_node; /* Node physically storing the object*/ #endif @@ -113,9 +114,9 @@ static inline objid_t pageindex_to_contentobjid(kerrighed_node_t nodeid, pgoff_t } -static inline pgoff_t contentobjid_to_pageindex(kerrighed_node_t nodeid, objid_t objid) +static inline pgoff_t contentobjid_to_pageindex(objid_t objid) { - return (objid-nodeid+1)/KDFS_MAX_NO_NODES; + return (objid-page_linked_node(objid)+1)/KDFS_MAX_NO_NODES; } ----------------------------------------------------------------------- Summary of changes: fs/kdfs/README | 4 +- fs/kdfs/address_space.c | 152 +++++++++++++++++++++++++++------------------- fs/kdfs/address_space.h | 5 +- 3 files changed, 94 insertions(+), 67 deletions(-) hooks/post-receive -- kdfs |
From: alebre <al...@us...> - 2010-03-31 17:03:54
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "kdfs". The branch, make_kdfs_compile has been updated via 287b2cc707a91d25ddf4888daa06170b9c4c9aa5 (commit) from 115803bcadc1f6bdffe6568a04ab76db941a71a7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 287b2cc707a91d25ddf4888daa06170b9c4c9aa5 Author: ad <leb...@fr...> Date: Wed Mar 31 18:57:57 2010 +0000 [MAJOR] implicit striping policy is running in some cases (some others are still crashing, for instance echo 1234 > /mnt/kdfs/foo on n node 1 and echo 5678 > /mnt/kdfs/foo on node 2 ; echo 1234 > /mnt/kdfs/foo2 on node 2 ; cat /mnt/kdfs/foo2 on node 1 -> crash diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index 2cb373c..983588a 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -190,8 +190,6 @@ int __kdfs_commit_write(struct file *file, if (((loff_t)page->index * PAGE_SIZE) + _to > k_inode->inode->i_size) i_size_write(k_inode->inode, ((loff_t)page->index * PAGE_SIZE) + _to); - /* set the page's owner to this node */ - kdfs_file_extent_set_page_owner(k_inode, page->index, kerrighed_node_id); /* * From the local node point of view, we have to set DIRTY flag to the page: * set_page_dirty(page); @@ -199,8 +197,9 @@ int __kdfs_commit_write(struct file *file, * chosen to directly call the kDDM sync functions (write through) */ // kdfs_mark_page_dirty(k_inode->content_setid, page->index); +// __kdfs_distput_page(k_inode->content_setid, page->index); kdfs_distmark_page_dirty(k_inode, page->index); - __kdfs_put_page(k_inode->content_setid, page->index); + _kdfs_put_page((struct kdfs_page*)page->private); kdfs_mark_inode_dirty(k_inode); kdfs_iput(k_inode->inode->i_ino); @@ -279,8 +278,6 @@ void kdfs_invalidatepage(struct page *page, unsigned long offset) int kdfs_releasepage(struct page *page, gfp_t mask) { struct kdfs_page *k_page; - kddm_obj_t *obj_entry; - kddm_set_t *associated_set; ASSERT (page->mapping != NULL); PRINT_FUNCTION_NAME; @@ -313,8 +310,9 @@ struct address_space_operations kdfs_aops = { // TODO NOW - Adrien, PROC functions, kdfs_ilocalfind is already called before kdfs_get/grab page. // I did that just to be faster, will improve that later if the code runs ;) struct kdfs_page *kdfs_get_distpage(struct kdfs_inode *k_inode, pgoff_t page_id){ + struct kdfs_page *k_page; DEBUG(DBG_INFO, "Get page %ld from set %ld\n", page_id, k_inode->content_setid); - struct kdfs_page *k_page =kdfs_get_page(k_inode->content_setid, + k_page =kdfs_get_page(k_inode->content_setid, pageindex_to_contentobjid( kdfs_file_extent_get_page_owner(k_inode, page_id),page_id)); return k_page; @@ -328,11 +326,39 @@ struct kdfs_page *kdfs_get_page(kddm_set_id_t set_id, objid_t obj_id) } struct kdfs_page *kdfs_grab_distpage(struct kdfs_inode *k_inode, pgoff_t page_id){ - DEBUG(DBG_INFO, "Gonna grab page %ld from set %ld\n", page_id, k_inode->content_setid); - struct kdfs_page *k_page =kdfs_grab_page(k_inode->content_setid, - pageindex_to_contentobjid( - kdfs_file_extent_get_page_owner(k_inode, page_id),page_id)); - return k_page; + struct kdfs_page *k_prevpage ; + struct kdfs_page *k_newpage ; + kdfs_node_t masternode ; + objid_t objid ; + + k_prevpage = k_newpage = NULL ; + + masternode = kdfs_file_extent_get_page_owner(k_inode, page_id) ; + + if(masternode == KDFS_NONE_NODEID) { + // The page is new and has to be assigned to the current node id (if possible: TODO handle diskless approach case) + masternode = kerrighed_node_id ; + kdfs_file_extent_set_page_owner(k_inode, page_id, masternode); + } else if (masternode != kerrighed_node_id) { + // the page already exists but teh grab is done remotely to the masternode, so : grab the previous object and reassign this page to the current node + objid = pageindex_to_contentobjid(masternode, page_id); + DEBUG(DBG_INFO, "Gonna grab prevpage %ld from set %ld (objid = %ld)\n", page_id, k_inode->content_setid, objid); + k_prevpage=kdfs_grab_page(k_inode->content_setid, objid); + /* set the page's owner to this node */ + masternode = kerrighed_node_id ; + kdfs_file_extent_set_page_owner(k_inode, page_id, masternode); + } + + objid = pageindex_to_contentobjid(masternode, page_id); + DEBUG(DBG_INFO, "Gonna grab page %ld from set %ld (objid = %ld)\n", page_id, k_inode->content_setid, objid); + k_newpage=kdfs_grab_page(k_inode->content_setid, objid); + + if(k_prevpage){ + _kdfs_put_page(k_prevpage); + // TODO Now - Adrien : destroy the k_prevpage (memory leak) + } + + return k_newpage; } @@ -368,7 +394,6 @@ void kdfs_distmark_page_dirty(struct kdfs_inode *k_inode, pgoff_t page_id){ kdfs_file_extent_get_page_owner(k_inode, page_id),page_id)); } - void kdfs_mark_page_dirty(kddm_set_id_t set_id, objid_t obj_id) { DEBUG(DBG_INFO, "Sync object %ld from set %lu\n", obj_id, set_id); @@ -561,13 +586,12 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, iolinker_data = (struct content_iolinker_data *) set->private_data; - DEBUG(DBG_TRACE, "file/directory = %ld, pageid = %ld gonna to retrieve inode \n", iolinker_data->ino, objid); + DEBUG(DBG_TRACE, "file/directory = %ld, pageid = %ld (objid = %ld)\n", iolinker_data->ino, contentobjid_to_pageindex(kerrighed_node_id,objid), objid); /* WARNING: quite ugly, we should not access to a local inode without locking the corresponding kddm object*/ k_mapping = ((struct content_iolinker_data *) set->private_data)->k_mapping; ASSERT(k_mapping); - - DEBUG(DBG_TRACE, "file/directory = %ld, pageid = %ld mapping = %p\n", iolinker_data->ino, objid, k_mapping); + DEBUG(DBG_TRACE, "file/directory = %ld, pageid = %ld mapping = %p\n", iolinker_data->ino,contentobjid_to_pageindex(kerrighed_node_id, objid), k_mapping); /* Allocate kdfs_page and retrieve page address */ k_page = kmalloc(sizeof(struct kdfs_page), GFP_KERNEL); @@ -583,9 +607,10 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, ASSERT(k_mapping != NULL); - k_page->page = find_get_page(k_mapping, objid); + /* The page can be already in the cache, especially when we dynamically change the default owner */ + k_page->page = find_get_page(k_mapping, contentobjid_to_pageindex(kerrighed_node_id,objid)); if (!k_page->page) { - DEBUG(DBG_ALERT, "Can't find page for file/directory = %ld and page id = %ld, So created and locked\n", iolinker_data->ino, objid); + DEBUG(DBG_ALERT, "Can't find page for file/directory = %ld and page id = %ld, So created and locked\n", iolinker_data->ino, contentobjid_to_pageindex(kerrighed_node_id, objid)); k_page->page = find_or_create_page(k_mapping, objid, (mapping_gfp_mask(k_mapping)|__GFP_ZERO) & ~__GFP_FS); k_page->flags = K_PG_locked; } else @@ -594,14 +619,14 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, DEBUG(DBG_ALERT, "After find Page count=%d\n", page_count(k_page->page)); page_addr = (char *) kmap(k_page->page); - pos = (loff_t)objid * PAGE_SIZE; + pos = (loff_t)contentobjid_to_pageindex(kerrighed_node_id, objid) * PAGE_SIZE; iolinker_data->content_readphyspage(iolinker_data, page_addr, pos); kunmap(k_page->page); if (!IS_ERR(k_page->page)) - DEBUG(DBG_ALERT, "Can't read page for file/directory = %ld and page id = %ld\n", iolinker_data->ino, objid); + DEBUG(DBG_ALERT, "Can't read page for file/directory = %ld and page id = %ld\n", iolinker_data->ino, contentobjid_to_pageindex(kerrighed_node_id, objid)); objEntry->object = (void *) k_page; @@ -769,7 +794,7 @@ int kdfs_iol_page_sync(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid) DEBUG(DBG_INFO, "Try to sync page %ld (page addr %p) of set %lu\n", objid, k_page->page, set->id); - file_pos = ((loff_t)objid * PAGE_SIZE) + k_page->offset; + file_pos = ((loff_t)contentobjid_to_pageindex(kerrighed_node_id, objid) * PAGE_SIZE) + k_page->offset; page_addr = (char *) kmap(k_page->page); pos_addr = page_addr + k_page->offset; diff --git a/fs/kdfs/common.h b/fs/kdfs/common.h index c087bc2..b426bad 100644 --- a/fs/kdfs/common.h +++ b/fs/kdfs/common.h @@ -18,7 +18,8 @@ #include <kddm/kddm.h> -#define KDFS_MIN_NODEID 0 +#define KDFS_NONE_NODEID 0 +#define KDFS_MIN_NODEID 1 #define KDFS_MAX_NODEID 255 #define KDFS_MAX_NO_NODES ((KDFS_MAX_NODEID) - (KDFS_MIN_NODEID) + 1) diff --git a/fs/kdfs/file_extent.c b/fs/kdfs/file_extent.c index 9ed5519..ae9f811 100644 --- a/fs/kdfs/file_extent.c +++ b/fs/kdfs/file_extent.c @@ -194,6 +194,8 @@ out: } +// Return the id of the node storing the page +// KDFS_NONE_NODEID otherwise kdfs_node_t kdfs_file_extent_get_page_owner(struct kdfs_inode *k_inode, pgoff_t page_no) { struct kdfs_file_extent *extent_before, *extent_in, *extent_after; @@ -205,7 +207,7 @@ kdfs_node_t kdfs_file_extent_get_page_owner(struct kdfs_inode *k_inode, pgoff_t return extent_in->data.extent_owner; } - return kerrighed_node_id; + return KDFS_NONE_NODEID; } ----------------------------------------------------------------------- Summary of changes: fs/kdfs/address_space.c | 65 ++++++++++++++++++++++++++++++++-------------- fs/kdfs/common.h | 3 +- fs/kdfs/file_extent.c | 4 ++- 3 files changed, 50 insertions(+), 22 deletions(-) hooks/post-receive -- kdfs |
From: alebre <al...@us...> - 2010-03-30 21:20:48
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "kdfs". The branch, make_kdfs_compile has been updated via 115803bcadc1f6bdffe6568a04ab76db941a71a7 (commit) via f7ea1dbc1e78e2f0cbc9326ee2e15c675974cef1 (commit) via 4851fdab0c827115c2dba01f90750fcf969dccef (commit) via e62164617eb03c6fdc8104426f7001470875ad21 (commit) via d52c6ffb65d4e42b13857f635adb293d7eeecf37 (commit) via 156d6a6f636830f2b175ea7be317bd32ac113420 (commit) via 77352c38128e22827b8991884a8cbb80684e4e4f (commit) from c43d260de5f117c8a4f258959c57794fa5cbe593 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 115803bcadc1f6bdffe6568a04ab76db941a71a7 Author: ad <leb...@fr...> Date: Tue Mar 30 21:52:10 2010 +0000 [MINOR] add kdfs_distmark_dirty (forgot it), the code is still not ok diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index 7d73f12..2cb373c 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -198,7 +198,8 @@ int __kdfs_commit_write(struct file *file, * However, due to the write behind issue at such a distributed level, we have * chosen to directly call the kDDM sync functions (write through) */ - kdfs_mark_page_dirty(k_inode->content_setid, page->index); +// kdfs_mark_page_dirty(k_inode->content_setid, page->index); + kdfs_distmark_page_dirty(k_inode, page->index); __kdfs_put_page(k_inode->content_setid, page->index); kdfs_mark_inode_dirty(k_inode); @@ -360,6 +361,14 @@ void _kdfs_put_page(struct kdfs_page *k_page) kddm_put_object(kddm_def_ns, k_page->set_id, k_page->obj_id); } +void kdfs_distmark_page_dirty(struct kdfs_inode *k_inode, pgoff_t page_id){ + DEBUG(DBG_INFO, "Gonna sync page %ld from set %ld\n", page_id, k_inode->content_setid); + kdfs_mark_page_dirty(k_inode->content_setid, + pageindex_to_contentobjid( + kdfs_file_extent_get_page_owner(k_inode, page_id),page_id)); +} + + void kdfs_mark_page_dirty(kddm_set_id_t set_id, objid_t obj_id) { DEBUG(DBG_INFO, "Sync object %ld from set %lu\n", obj_id, set_id); diff --git a/fs/kdfs/address_space.h b/fs/kdfs/address_space.h index 2a1b26c..73e6e01 100644 --- a/fs/kdfs/address_space.h +++ b/fs/kdfs/address_space.h @@ -129,6 +129,7 @@ void _kdfs_put_page(struct kdfs_page *k_page); void __kdfs_put_page(kddm_set_id_t set_id, objid_t obj_id); +void kdfs_distmark_page_dirty(struct kdfs_inode *k_inode, pgoff_t page_id); void kdfs_mark_page_dirty(kddm_set_id_t set_id, objid_t obj_id); int kdfs_iol_page_alloc(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid); commit f7ea1dbc1e78e2f0cbc9326ee2e15c675974cef1 Author: ad <leb...@fr...> Date: Tue Mar 30 18:40:02 2010 +0000 [MINOR] some progress toward the solution....(WARNING: compilation ok, execution needs to be deeply tested diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index 3008ddf..7d73f12 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -86,7 +86,7 @@ int kdfs_readpage(struct file *file, struct page *page) /* TODO PRIORITY 2: test kdfs_get_page returned value */ // k_page = kdfs_get_page(k_inode->content_setid,page->index); - k_page = kdfs_get_distpage(k_inode->content_setid,page->index); + k_page = kdfs_get_distpage(k_inode,page->index); DEBUG(DBG_INFO, " Readpage k_page->page : %p and page %p\n", k_page->page, page); BUG_ON(k_page->page != page); @@ -116,7 +116,7 @@ int __kdfs_prepare_write (struct file *file, struct page *page, struct kdfs_page *k_page = NULL; struct kdfs_inode *k_inode = NULL; - DEBUG (DBG_INFO, "begin_write for file %s (ino %ld), page %ld from %d to %d (count = %d, mapping = %p)\n", + DEBUG (DBG_INFO, "prepare_write for file %s (ino %ld), page %ld from %d to %d (count = %d, mapping = %p)\n", file->f_dentry->d_name.name, file->f_dentry->d_inode->i_ino, page->index, offset, _to, page_count(page), page->mapping); BUG_ON (page->mapping == NULL); @@ -128,7 +128,7 @@ int __kdfs_prepare_write (struct file *file, struct page *page, } /* TODO PRIORITY 2: test kdfs_grab_page returned value */ - k_page = kdfs_grab_distpage(k_inode->content_setid, page->index); + k_page = kdfs_grab_distpage(k_inode, page->index); BUG_ON(k_page->page != page) ; k_page->offset = offset; k_page->to = _to; @@ -263,9 +263,10 @@ void kdfs_invalidatepage(struct page *page, unsigned long offset) else { //TODO Now Adrien : Fix that : sure or not sure ? /* Not sure about this */ - kdfs_grab_distpage(k_page->set_id, k_page->obj_id); - kddm_sync_frozen_object(kddm_def_ns, k_page->set_id, k_page->obj_id); - __kdfs_put_page(k_page->set_id, k_page->obj_id); + ASSERT (1==0); + // kdfs_grab_distpage(k_page->set_id, k_page->obj_id); + // kddm_sync_frozen_object(kddm_def_ns, k_page->set_id, k_page->obj_id); +// __kdfs_put_page(k_page->set_id, k_page->obj_id); } PRINT_FUNCTION_EXIT; } @@ -284,19 +285,8 @@ int kdfs_releasepage(struct page *page, gfp_t mask) PRINT_FUNCTION_NAME; k_page = (struct kdfs_page *) page->private; - associated_set = _find_get_kddm_set(kddm_def_ns, k_page->set_id); - obj_entry = __get_kddm_obj_entry(associated_set, k_page->obj_id); - if (OBJ_EXCLUSIVE2(COPYSET(obj_entry))) { - put_kddm_obj_entry(associated_set, obj_entry, k_page->obj_id); - put_kddm_set(associated_set); - kdfs_grab_distpage(k_page->set_id, k_page->obj_id); - kddm_remove_frozen_object(kddm_def_ns, k_page->set_id, k_page->obj_id); - } - else { - put_kddm_obj_entry(associated_set, obj_entry, k_page->obj_id); - put_kddm_set(associated_set); - kddm_flush_object(kddm_def_ns, k_page->set_id, k_page->obj_id, KERRIGHED_NODE_ID_NONE); - } + + kddm_flush_object(kddm_def_ns, k_page->set_id, k_page->obj_id, KERRIGHED_NODE_ID_NONE); ClearPagePrivate(page); PRINT_FUNCTION_EXIT; @@ -321,13 +311,11 @@ struct address_space_operations kdfs_aops = { // TODO NOW - Adrien, PROC functions, kdfs_ilocalfind is already called before kdfs_get/grab page. // I did that just to be faster, will improve that later if the code runs ;) -struct kdfs_page *kdfs_get_distpage(kddm_set_id_t set_id, pgoff_t page_id){ - DEBUG(DBG_INFO, "Get page %ld from set %ld\n", page_id, set_id); - struct kdfs_inode *k_inode = kdfs_ilocalfind(set_id); +struct kdfs_page *kdfs_get_distpage(struct kdfs_inode *k_inode, pgoff_t page_id){ + DEBUG(DBG_INFO, "Get page %ld from set %ld\n", page_id, k_inode->content_setid); struct kdfs_page *k_page =kdfs_get_page(k_inode->content_setid, pageindex_to_contentobjid( kdfs_file_extent_get_page_owner(k_inode, page_id),page_id)); - kdfs_iput(k_inode->inode->i_ino); return k_page; } @@ -338,13 +326,11 @@ struct kdfs_page *kdfs_get_page(kddm_set_id_t set_id, objid_t obj_id) return kddm_get_object(kddm_def_ns, set_id, obj_id); } -struct kdfs_page *kdfs_grab_distpage(kddm_set_id_t set_id, pgoff_t page_id){ - DEBUG(DBG_INFO, "Grab page %ld from set %ld\n", page_id, set_id); - struct kdfs_inode *k_inode = kdfs_ilocalfind(set_id); +struct kdfs_page *kdfs_grab_distpage(struct kdfs_inode *k_inode, pgoff_t page_id){ + DEBUG(DBG_INFO, "Gonna grab page %ld from set %ld\n", page_id, k_inode->content_setid); struct kdfs_page *k_page =kdfs_grab_page(k_inode->content_setid, pageindex_to_contentobjid( kdfs_file_extent_get_page_owner(k_inode, page_id),page_id)); - kdfs_iput(k_inode->inode->i_ino); return k_page; } diff --git a/fs/kdfs/address_space.h b/fs/kdfs/address_space.h index 939a9a7..2a1b26c 100644 --- a/fs/kdfs/address_space.h +++ b/fs/kdfs/address_space.h @@ -104,7 +104,7 @@ struct kdfs_page { // Return the node in charge of storing the kddm object // Used in default_owner for the content I/O linker static inline kerrighed_node_t page_linked_node(objid_t objid){ - return objid%KDFS_MAX_NO_NODES; + return (objid%KDFS_MAX_NO_NODES) + 1; } static inline objid_t pageindex_to_contentobjid(kerrighed_node_t nodeid, pgoff_t pageid) @@ -119,9 +119,9 @@ static inline pgoff_t contentobjid_to_pageindex(kerrighed_node_t nodeid, objid_t } -struct kdfs_page *kdfs_get_distpage(kddm_set_id_t set_id, objid_t obj_id); +struct kdfs_page *kdfs_get_distpage(struct kdfs_inode *k_inode, objid_t obj_id); struct kdfs_page *kdfs_get_page(kddm_set_id_t set_id, objid_t obj_id); -struct kdfs_page *kdfs_grab_distpage(kddm_set_id_t set_id, objid_t obj_id); +struct kdfs_page *kdfs_grab_distpage(struct kdfs_inode *k_inode, objid_t obj_id); struct kdfs_page *kdfs_grab_page(kddm_set_id_t set_id, objid_t obj_id); struct kdfs_page *kdfs_findlocal_page(kddm_set_id_t set_id, objid_t obj_id); diff --git a/fs/kdfs/file_extent.c b/fs/kdfs/file_extent.c index 49fd1ba..9ed5519 100644 --- a/fs/kdfs/file_extent.c +++ b/fs/kdfs/file_extent.c @@ -44,6 +44,8 @@ int kdfs_file_extent_find(struct list_head *extents, pgoff_t page_no, struct kdf *ext_before = *ext_in = *ext_after = NULL; + ASSERT(extents!=NULL); + if (list_empty(extents)) { return 1; } @@ -196,6 +198,7 @@ kdfs_node_t kdfs_file_extent_get_page_owner(struct kdfs_inode *k_inode, pgoff_t { struct kdfs_file_extent *extent_before, *extent_in, *extent_after; + DEBUG(DBG_INFO, "Try to access the extent of ino : %ld\n",k_inode->inode->i_ino); kdfs_file_extent_find(&k_inode->extents_list, page_no, &extent_before, &extent_in, &extent_after); if (extent_in) { commit 4851fdab0c827115c2dba01f90750fcf969dccef Merge: e621646 c43d260 Author: ad <leb...@fr...> Date: Tue Mar 30 12:54:17 2010 +0000 Merge branch 'make_kdfs_compile' of ssh://kdfs.git.sourceforge.net/gitroot/kdfs/kernel into make_kdfs_compile commit e62164617eb03c6fdc8104426f7001470875ad21 Author: ad <leb...@fr...> Date: Tue Mar 30 12:13:21 2010 +0000 [MAJOR] add hashing code for the striping policy (WARNING: THIS CODE HAS NOT BEEN TESTED) diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index 62d64fb..3008ddf 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -9,6 +9,7 @@ * @maintainer Adrien Lebre * * Copyright (C) 2006-2007, XtreemOS Consortium. + * Copyright (C) 2008-20xx, Mines Nantes - INRIA Rennes Bretagne Atlantique - LINA . */ #include <linux/pagemap.h> @@ -84,7 +85,8 @@ int kdfs_readpage(struct file *file, struct page *page) k_inode->inode->i_ino, list_entry(k_inode->inode->i_dentry.next, struct dentry, d_alias)->d_name.name); /* TODO PRIORITY 2: test kdfs_get_page returned value */ - k_page = kdfs_get_page(k_inode->content_setid, page->index); +// k_page = kdfs_get_page(k_inode->content_setid,page->index); + k_page = kdfs_get_distpage(k_inode->content_setid,page->index); DEBUG(DBG_INFO, " Readpage k_page->page : %p and page %p\n", k_page->page, page); BUG_ON(k_page->page != page); @@ -125,8 +127,8 @@ int __kdfs_prepare_write (struct file *file, struct page *page, DEBUG (DBG_PANIC, "No contentset associated.... looks really strange \n"); } - /* TODO PRIORITY 2: test kdfs_get_page returned value */ - k_page = kdfs_grab_page(k_inode->content_setid, page->index); + /* TODO PRIORITY 2: test kdfs_grab_page returned value */ + k_page = kdfs_grab_distpage(k_inode->content_setid, page->index); BUG_ON(k_page->page != page) ; k_page->offset = offset; k_page->to = _to; @@ -259,8 +261,9 @@ void kdfs_invalidatepage(struct page *page, unsigned long offset) ClearPagePrivate(page); } else { + //TODO Now Adrien : Fix that : sure or not sure ? /* Not sure about this */ - kdfs_grab_page(k_page->set_id, k_page->obj_id); + kdfs_grab_distpage(k_page->set_id, k_page->obj_id); kddm_sync_frozen_object(kddm_def_ns, k_page->set_id, k_page->obj_id); __kdfs_put_page(k_page->set_id, k_page->obj_id); } @@ -286,7 +289,7 @@ int kdfs_releasepage(struct page *page, gfp_t mask) if (OBJ_EXCLUSIVE2(COPYSET(obj_entry))) { put_kddm_obj_entry(associated_set, obj_entry, k_page->obj_id); put_kddm_set(associated_set); - kdfs_grab_page(k_page->set_id, k_page->obj_id); + kdfs_grab_distpage(k_page->set_id, k_page->obj_id); kddm_remove_frozen_object(kddm_def_ns, k_page->set_id, k_page->obj_id); } else { @@ -315,27 +318,48 @@ struct address_space_operations kdfs_aops = { /* ADDRESS SPACE LINKER PART */ /* */ /*****************************************************************************/ -// struct kdfs_inode *k_inode = kdfs_ilocalfind(my_data->ino); -// ret_val = kdfs_file_extent_get_page_owner(k_inode, objid); -// kdfs_iput(k_inode->inode->i_ino); - +// TODO NOW - Adrien, PROC functions, kdfs_ilocalfind is already called before kdfs_get/grab page. +// I did that just to be faster, will improve that later if the code runs ;) +struct kdfs_page *kdfs_get_distpage(kddm_set_id_t set_id, pgoff_t page_id){ + DEBUG(DBG_INFO, "Get page %ld from set %ld\n", page_id, set_id); + struct kdfs_inode *k_inode = kdfs_ilocalfind(set_id); + struct kdfs_page *k_page =kdfs_get_page(k_inode->content_setid, + pageindex_to_contentobjid( + kdfs_file_extent_get_page_owner(k_inode, page_id),page_id)); + kdfs_iput(k_inode->inode->i_ino); + return k_page; +} + struct kdfs_page *kdfs_get_page(kddm_set_id_t set_id, objid_t obj_id) { - DEBUG(DBG_INFO, "Get page %ld from set %ld\n", obj_id, set_id); + DEBUG(DBG_INFO, "Get object %ld from set %ld\n", obj_id, set_id); return kddm_get_object(kddm_def_ns, set_id, obj_id); } +struct kdfs_page *kdfs_grab_distpage(kddm_set_id_t set_id, pgoff_t page_id){ + DEBUG(DBG_INFO, "Grab page %ld from set %ld\n", page_id, set_id); + struct kdfs_inode *k_inode = kdfs_ilocalfind(set_id); + struct kdfs_page *k_page =kdfs_grab_page(k_inode->content_setid, + pageindex_to_contentobjid( + kdfs_file_extent_get_page_owner(k_inode, page_id),page_id)); + kdfs_iput(k_inode->inode->i_ino); + return k_page; +} + + struct kdfs_page *kdfs_grab_page(kddm_set_id_t set_id, objid_t obj_id) { - DEBUG(DBG_INFO, "Grab page %ld from set %ld\n", obj_id, set_id); + + DEBUG(DBG_INFO, "Grab object %ld from set %ld\n", obj_id, set_id); + return kddm_grab_object(kddm_def_ns, set_id, obj_id); } struct kdfs_page *kdfs_findlocal_page(kddm_set_id_t set_id, objid_t obj_id) { - DEBUG(DBG_INFO, "Grab page %ld from set %ld\n", obj_id, set_id); + DEBUG(DBG_INFO, "Grab object %ld from set %ld\n", obj_id, set_id); return kddm_find_object(kddm_def_ns, set_id, obj_id); } @@ -346,13 +370,13 @@ void __kdfs_put_page(kddm_set_id_t set_id, objid_t obj_id) void _kdfs_put_page(struct kdfs_page *k_page) { - DEBUG(DBG_INFO, "Put page %ld from set %ld\n", k_page->obj_id, k_page->set_id); + DEBUG(DBG_INFO, "Put object %ld from set %ld\n", k_page->obj_id, k_page->set_id); kddm_put_object(kddm_def_ns, k_page->set_id, k_page->obj_id); } void kdfs_mark_page_dirty(kddm_set_id_t set_id, objid_t obj_id) { - DEBUG(DBG_INFO, "Sync page %ld from set %lu\n", obj_id, set_id); + DEBUG(DBG_INFO, "Sync object %ld from set %lu\n", obj_id, set_id); kddm_sync_frozen_object(kddm_def_ns, set_id, obj_id); } diff --git a/fs/kdfs/address_space.h b/fs/kdfs/address_space.h index aab2433..939a9a7 100644 --- a/fs/kdfs/address_space.h +++ b/fs/kdfs/address_space.h @@ -9,7 +9,7 @@ * @maintainer Adrien Lebre * * Copyright (C) 2006-2007, XtreemOS Consortium. - * Copyright (C) 2008-20xx, XtreemOS Consortium, Ascola Research Group. + * Copyright (C) 2008-20xx, Mines Nantes - INRIA Rennes Bretagne Atlantique - LINA . */ #ifndef __KDFS_ADDR_SPACE__ @@ -48,7 +48,7 @@ struct kdfs_meta { struct content_iolinker_data { ino_t ino; /* inode id */ - + /* * Reference to the associated adress_space structure required to * manipulate page cache. @@ -101,8 +101,27 @@ struct kdfs_page { * PROTOTYPES * * * *--------------------------------------------------------------------------*/ +// Return the node in charge of storing the kddm object +// Used in default_owner for the content I/O linker +static inline kerrighed_node_t page_linked_node(objid_t objid){ + return objid%KDFS_MAX_NO_NODES; +} + +static inline objid_t pageindex_to_contentobjid(kerrighed_node_t nodeid, pgoff_t pageid) +{ + return pageid*KDFS_MAX_NO_NODES + nodeid - 1; + +} + +static inline pgoff_t contentobjid_to_pageindex(kerrighed_node_t nodeid, objid_t objid) +{ + return (objid-nodeid+1)/KDFS_MAX_NO_NODES; +} + +struct kdfs_page *kdfs_get_distpage(kddm_set_id_t set_id, objid_t obj_id); struct kdfs_page *kdfs_get_page(kddm_set_id_t set_id, objid_t obj_id); +struct kdfs_page *kdfs_grab_distpage(kddm_set_id_t set_id, objid_t obj_id); struct kdfs_page *kdfs_grab_page(kddm_set_id_t set_id, objid_t obj_id); struct kdfs_page *kdfs_findlocal_page(kddm_set_id_t set_id, objid_t obj_id); diff --git a/fs/kdfs/common.h b/fs/kdfs/common.h index cba32d0..c087bc2 100644 --- a/fs/kdfs/common.h +++ b/fs/kdfs/common.h @@ -6,7 +6,7 @@ * @author Marko Obrovac (2010-xxxx) * * Copyright (C) 2006-2007, XtreemOS Consortium. - * Copyright (C) 2008-20xx, XtreemOS Consortium, Ascola Research Group. + * Copyright (C) 2008-20xx, Mines Nantes - INRIA Rennes Bretagne Atlantique - LINA . */ #ifndef __KDFS_COMMON__ @@ -18,6 +18,10 @@ #include <kddm/kddm.h> +#define KDFS_MIN_NODEID 0 +#define KDFS_MAX_NODEID 255 +#define KDFS_MAX_NO_NODES ((KDFS_MAX_NODEID) - (KDFS_MIN_NODEID) + 1) + /* Max number of extent records that fit in a kddm object */ /* if you change the kdfs_netinode or kdfs_file_extent_info @@ -113,4 +117,5 @@ struct kdfs_physical_inode { }; + #endif diff --git a/fs/kdfs/file.c b/fs/kdfs/file.c index 13339bb..70de1ec 100644 --- a/fs/kdfs/file.c +++ b/fs/kdfs/file.c @@ -9,6 +9,7 @@ * @maintainer Adrien Lebre * * Copyright (C) 2006-2007, XtreemOS Consortium. + * Copyright (C) 2008-20xx, Mines Nantes - INRIA Rennes Bretagne Atlantique - LINA . */ #include <linux/buffer_head.h> @@ -258,15 +259,12 @@ kerrighed_node_t kdfs_iol_file_default_owner (kddm_set_t *kddm_set, int nr_nodes) { kerrighed_node_t ret_val; - // TODO Now : Adrien, the following line is obsolete right now - struct content_iolinker_data *my_data = (struct content_iolinker_data *)kddm_set->private_data; // check who's the default owner of the object !!! ret_val = page_linked_node(objid); DEBUG(DBG_INFO, "######### /\\/\\/\\/ page owner ::: %d\n", ret_val); return ret_val; - //return 2; } /* diff --git a/fs/kdfs/file_extent.c b/fs/kdfs/file_extent.c index 74f0af8..0eb2355 100644 --- a/fs/kdfs/file_extent.c +++ b/fs/kdfs/file_extent.c @@ -60,7 +60,6 @@ int kdfs_file_extent_find(struct list_head *extents, pgoff_t page_no, struct kdf *ext_before = curr; } } - return 1; } diff --git a/fs/kdfs/file_extent.h b/fs/kdfs/file_extent.h index 1597a5e..6b2ea31 100644 --- a/fs/kdfs/file_extent.h +++ b/fs/kdfs/file_extent.h @@ -6,7 +6,7 @@ * @author Marko Obrovac (2010-xxxx) * * Copyright (C) 2006-2007, XtreemOS Consortium. - * Copyright (C) 2008-20xx, XtreemOS Consortium, Ascola Research Group. + * Copyright (C) 2008-20xx, Mines Nantes - INRIA Rennes Bretagne Atlantique - LINA . */ #ifndef __KDFS_FILE_EXTENT__ diff --git a/fs/kdfs/inode.h b/fs/kdfs/inode.h index 1581ef5..fd33d86 100644 --- a/fs/kdfs/inode.h +++ b/fs/kdfs/inode.h @@ -9,6 +9,7 @@ * @maintainer Adrien Lebre * * Copyright (C) 2006-2007, XtreemOS Consortium. + * Copyright (C) 2008-20xx, Mines Nantes - INRIA Rennes Bretagne Atlantique - LINA . */ #ifndef __KDFS_INODE__ diff --git a/fs/kdfs/super.h b/fs/kdfs/super.h index 38c9efc..fb32ada 100644 --- a/fs/kdfs/super.h +++ b/fs/kdfs/super.h @@ -9,6 +9,7 @@ * @maintainer Adrien Lebre * * Copyright (C) 2006-2007, XtreemOS Consortium. + * Copyright (C) 2008-20xx, Mines Nantes - INRIA Rennes Bretagne Atlantique - LINA . */ #ifndef __KDFS_SUPER__ @@ -18,11 +19,8 @@ #include <asm/page.h> #include <linux/statfs.h> - - #include "common.h" - /*--------------------------------------------------------------------------* * * * MACROS * @@ -43,9 +41,6 @@ #define KDFS_COMPUTE_ROOT_INODEID(kdfs_sb)\ ((kdfs_sb->root_nodeid << 24) + KDFS_ROOT_INODEID) -#define KDFS_MIN_NODEID 0 -#define KDFS_MAX_NODEID 255 -#define KDFS_MAX_NO_NODES ((KDFS_MAX_NODEID) - (KDFS_MIN_NODEID) + 1) #define KDFS_CWSB_ID ((KDFS_MAX_NODEID) + 1) #define KDFS_LOCALINODE_MASK 0x00FFFFFF /* the first 8 bits are reserved for the nodeid */ #define KDFS_NODEID_MASK 0xFF000000 /* the nodeid in the ino */ commit d52c6ffb65d4e42b13857f635adb293d7eeecf37 Merge: 156d6a6 1b9e05a Author: ad <leb...@fr...> Date: Fri Mar 26 17:14:19 2010 +0000 [FIX] fix conflict on the last pull diff --cc fs/kdfs/address_space.c index f81abe2,8ef8f46..62d64fb --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@@ -898,15 -895,16 +900,16 @@@ int content_instantiate(kddm_set_t *kdd content_data->k_mapping = inode->i_mapping; iput(inode); } else if (inode_linked_node(content_data->ino) == kerrighed_node_id){ - DEBUG(DBG_INFO, "K_mapping will be retrieve from iget - the inode is on this node\n"); + DEBUG(DBG_INFO, "K_mapping will be retrieve from iget\n"); inode = kdfs_getinode(k_sb->sb, content_data->ino); content_data->k_mapping = inode->i_mapping; - } else { - DEBUG(DBG_INFO, "K_mapping created from dummy inode info\n"); + } else { + /* do dummy stuff */ + DEBUG(DBG_INFO, "K_mapping exploits a dummy inode\n"); inode = new_inode(k_sb->sb); - inode->i_ino = content_data->ino; - insert_inode_hash(inode); - //inode = kdfs_getinode(k_sb->sb, content_data->ino); + inode->i_ino = content_data->ino; + insert_inode_hash(inode); + content_data->k_mapping = inode->i_mapping; } if (!content_data->k_mapping) DEBUG(DBG_PANIC, "k_mapping was not cleanly initialized\n"); diff --cc fs/kdfs/file.c index 789ddb7,a6dab7a..13339bb --- a/fs/kdfs/file.c +++ b/fs/kdfs/file.c @@@ -257,13 -257,22 +257,13 @@@ kerrighed_node_t kdfs_iol_file_default_ const krgnodemask_t *nodes, int nr_nodes) { - /* - * TODO NOW, Adrien - * Implement - */ kerrighed_node_t ret_val; ++ // TODO Now : Adrien, the following line is obsolete right now struct content_iolinker_data *my_data = (struct content_iolinker_data *)kddm_set->private_data; - - struct kdfs_inode *k_inode = kdfs_ilocalfind(my_data->ino); - - ASSERT(k_inode); - // check who's the default owner of the object !!! - //ret_val = inode_linked_node(k_inode->inode->i_ino); - ret_val = kdfs_file_extent_get_page_owner(k_inode, objid); - kdfs_iput(k_inode->inode->i_ino); - + ret_val = page_linked_node(objid); + DEBUG(DBG_INFO, "######### /\\/\\/\\/ page owner ::: %d\n", ret_val); return ret_val; //return 2; commit 156d6a6f636830f2b175ea7be317bd32ac113420 Author: ad <leb...@fr...> Date: Fri Mar 26 17:05:13 2010 +0000 [MINOR] start to implement the hash mechanism for page locations diff --git a/fs/kdfs/KNOWN_BUGS b/fs/kdfs/KNOWN_BUGS index 213c63b..412c47e 100644 --- a/fs/kdfs/KNOWN_BUGS +++ b/fs/kdfs/KNOWN_BUGS @@ -27,6 +27,10 @@ ls -alR /mnt/kdfs/ leads to an infinite loop (size of DIR2 equals 268 bytes) Check, the size should be zero +Wed Mar 24 12:24:34 UTC 2010 +Can't umount a kDFS partition from the whole kDFS structure + + Miscellaneous knwon bugs diff --git a/fs/kdfs/file.c b/fs/kdfs/file.c index 45a7835..789ddb7 100644 --- a/fs/kdfs/file.c +++ b/fs/kdfs/file.c @@ -257,20 +257,13 @@ kerrighed_node_t kdfs_iol_file_default_owner (kddm_set_t *kddm_set, const krgnodemask_t *nodes, int nr_nodes) { - /* - * TODO NOW, Adrien - * Implement - */ kerrighed_node_t ret_val; struct content_iolinker_data *my_data = (struct content_iolinker_data *)kddm_set->private_data; - struct kdfs_inode *k_inode = kdfs_ilocalfind(my_data->ino); - + // check who's the default owner of the object !!! - //ret_val = inode_linked_node(k_inode->inode->i_ino); - ret_val = kdfs_file_extent_get_page_owner(k_inode, objid); - kdfs_iput(k_inode->inode->i_ino); - + ret_val = page_linked_node(objid); + DEBUG(DBG_INFO, "######### /\\/\\/\\/ page owner ::: %d\n", ret_val); return ret_val; //return 2; diff --git a/fs/kdfs/inode.c b/fs/kdfs/inode.c index 92efd40..2e238a3 100644 --- a/fs/kdfs/inode.c +++ b/fs/kdfs/inode.c @@ -1075,11 +1075,14 @@ int kdfs_iol_inode_alloc_object (kddm_obj_t *objEntry, objEntry->object = k_inode; } else { - /* Object id has beend already allocated so reused the same structure */ + /* Object id has been already allocated so reused the same structure */ DEBUG(DBG_PANIC, "Object %ld was already allocated \n", objid); //kdfs_inode = (struct kdfs_inode*) objEntry->object; // seems to be useless since we do not have to return the object } + /* TODO PRIORITY 3: Adrien + * interest of the following code inside the alloc function + */ if (inode_linked_node(objid) == kerrighed_node_id) { char *phys_dirname; /* Find the physical path corresponding to the KDFS inode */ @@ -1140,8 +1143,7 @@ int kdfs_iol_inode_first_touch(kddm_obj_t *objEntry, DEBUG(DBG_PANIC, "Cannot find inode %ld\n", objid); k_inode->inode->i_ino = objid; insert_inode_hash(k_inode->inode); - } - else { + } else { /* * Check if the inode is locally in the cache * Can happen when a content associated kddm set has been instantiated @@ -1231,7 +1233,7 @@ int kdfs_iol_inode_import_object(struct rpc_desc *desc, res = rpc_unpack_type(desc, net_src); kdfs_import_kdfs_inode(inode_dst, &net_src); - + /* import the extents part */ kdfs_file_extent_net_import(inode_dst, &net_src); commit 77352c38128e22827b8991884a8cbb80684e4e4f Author: alebre <alebre@krgserver.dirty.world> Date: Fri Mar 26 16:58:59 2010 +0000 [MINOR] start to implement the hash mechanism for page locations diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index 8c658b2..f81abe2 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -313,6 +313,11 @@ struct address_space_operations kdfs_aops = { /* ADDRESS SPACE LINKER PART */ /* */ /*****************************************************************************/ +// struct kdfs_inode *k_inode = kdfs_ilocalfind(my_data->ino); +// ret_val = kdfs_file_extent_get_page_owner(k_inode, objid); +// kdfs_iput(k_inode->inode->i_ino); + + struct kdfs_page *kdfs_get_page(kddm_set_id_t set_id, objid_t obj_id) { @@ -892,10 +897,16 @@ int content_instantiate(kddm_set_t *kddm_set, void *private_data, int master) DEBUG(DBG_INFO, "K_mapping from the cache\n"); content_data->k_mapping = inode->i_mapping; iput(inode); - } else { + } else if (inode_linked_node(content_data->ino) == kerrighed_node_id){ DEBUG(DBG_INFO, "K_mapping will be retrieve from iget\n"); inode = kdfs_getinode(k_sb->sb, content_data->ino); content_data->k_mapping = inode->i_mapping; + } else { + /* do dummy stuff */ + DEBUG(DBG_INFO, "K_mapping exploits a dummy inode\n"); + inode = new_inode(k_sb->sb); + inode->i_ino = content_data->ino; + insert_inode_hash(inode); } if (!content_data->k_mapping) DEBUG(DBG_PANIC, "k_mapping was not cleanly initialized\n"); @@ -905,6 +916,7 @@ int content_instantiate(kddm_set_t *kddm_set, void *private_data, int master) return result; } + /* * Uninstantiate a content container. * @author Adrien Lebre ----------------------------------------------------------------------- Summary of changes: fs/kdfs/KNOWN_BUGS | 4 ++ fs/kdfs/address_space.c | 89 ++++++++++++++++++++++++++++++----------------- fs/kdfs/address_space.h | 24 +++++++++++- fs/kdfs/common.h | 7 +++- fs/kdfs/file.c | 17 ++------- fs/kdfs/file_extent.c | 4 ++- fs/kdfs/file_extent.h | 2 +- fs/kdfs/inode.c | 10 +++-- fs/kdfs/inode.h | 1 + fs/kdfs/super.h | 7 +--- 10 files changed, 104 insertions(+), 61 deletions(-) hooks/post-receive -- kdfs |
From: Marko O. <d0...@us...> - 2010-03-30 10:08:30
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "kdfs". The branch, make_kdfs_compile has been updated via c43d260de5f117c8a4f258959c57794fa5cbe593 (commit) from 1b9e05ab401cc4a857b15868a3097dfe21f43c46 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c43d260de5f117c8a4f258959c57794fa5cbe593 Author: Marko Obrovac <mar...@in...> Date: Tue Mar 30 14:05:32 2010 +0200 List handling improvement Before handling the list's element, check it's not empty diff --git a/fs/kdfs/file_extent.c b/fs/kdfs/file_extent.c index 74f0af8..94c442c 100644 --- a/fs/kdfs/file_extent.c +++ b/fs/kdfs/file_extent.c @@ -44,6 +44,10 @@ int kdfs_file_extent_find(struct list_head *extents, pgoff_t page_no, struct kdf *ext_before = *ext_in = *ext_after = NULL; + if (list_empty(extents)) { + return 1; + } + list_for_each_entry(curr, extents, list_item) { if (curr->data.page_first <= page_no && curr->data.page_last >= page_no) { /* the page is inside this extent */ @@ -177,8 +181,10 @@ int kdfs_file_extent_set_page_owner(struct kdfs_inode *k_inode, pgoff_t page_no, out: DEBUG(DBG_INFO, "LIST CONTENTS AFTER MANIP\n"); - list_for_each_entry(curr, &k_inode->extents_list, list_item) { - DEBUG(DBG_INFO, "#################### f=%lu, l=%lu, o=%d\n", curr->data.page_first, curr->data.page_last, curr->data.extent_owner); + if (!list_empty(&k_inode->extents_list)) { + list_for_each_entry(curr, &k_inode->extents_list, list_item) { + DEBUG(DBG_INFO, "#################### f=%lu, l=%lu, o=%d\n", curr->data.page_first, curr->data.page_last, curr->data.extent_owner); + } } PRINT_FUNCTION_EXIT; @@ -209,17 +215,21 @@ size_t kdfs_file_extent_dump_to_file(struct kdfs_inode *k_inode, struct file *fi ASSERT(k_inode != NULL); - list_for_each_entry(curr, &k_inode->extents_list, list_item) { - list_count++; + if (!list_empty(&k_inode->extents_list)) { + list_for_each_entry(curr, &k_inode->extents_list, list_item) { + list_count++; + } } bytes_written += kdfs_phys_write(file, (char *) &(list_count), sizeof(size_t), &file->f_pos); - list_for_each_entry(curr, &k_inode->extents_list, list_item) { - bytes_written += kdfs_phys_write(file, - (char *) &(curr->data), sizeof(struct kdfs_file_extent_info), - &file->f_pos); + if (!list_empty(&k_inode->extents_list)) { + list_for_each_entry(curr, &k_inode->extents_list, list_item) { + bytes_written += kdfs_phys_write(file, + (char *) &(curr->data), sizeof(struct kdfs_file_extent_info), + &file->f_pos); + } } return bytes_written; @@ -266,8 +276,10 @@ size_t kdfs_file_extent_read_from_file(struct kdfs_inode *k_inode) kfree(phys_filename); DEBUG(DBG_INFO, "\n\n\nLIST CONTENTS AFTER READ\n"); - list_for_each_entry(curr, &k_inode->extents_list, list_item) { - DEBUG(DBG_INFO, "#################### f=%lu, l=%lu, o=%d\n", curr->data.page_first, curr->data.page_last, curr->data.extent_owner); + if (!list_empty(&k_inode->extents_list)) { + list_for_each_entry(curr, &k_inode->extents_list, list_item) { + DEBUG(DBG_INFO, "#################### f=%lu, l=%lu, o=%d\n", curr->data.page_first, curr->data.page_last, curr->data.extent_owner); + } } return 0; @@ -281,15 +293,17 @@ void kdfs_file_extent_net_export(struct kdfs_inode *k_inode, struct kdfs_netinod DEBUG(DBG_INFO, "Exporting the extents list for inode %lu\n", k_inode->inode->i_ino); - list_for_each_entry(curr, &k_inode->extents_list, list_item) { - net_inode->extents[list_count].page_first = curr->data.page_first; - net_inode->extents[list_count].page_last = curr->data.page_last; - net_inode->extents[list_count].extent_owner = curr->data.extent_owner; - //DEBUG(DBG_INFO, "Exporting <%lu, %lu, %d>\n", net_inode->extents[list_count].page_first, net_inode->extents[list_count].page_last, net_inode->extents[list_count].extent_owner); - list_count++; - if (list_count == FILE_EXT_MAX_MEMBERS) { - DEBUG(DBG_ALERT, "The list is too large to export! Exporting only partially\n"); - break; + if (!list_empty(&k_inode->extents_list)) { + list_for_each_entry(curr, &k_inode->extents_list, list_item) { + net_inode->extents[list_count].page_first = curr->data.page_first; + net_inode->extents[list_count].page_last = curr->data.page_last; + net_inode->extents[list_count].extent_owner = curr->data.extent_owner; + //DEBUG(DBG_INFO, "Exporting <%lu, %lu, %d>\n", net_inode->extents[list_count].page_first, net_inode->extents[list_count].page_last, net_inode->extents[list_count].extent_owner); + list_count++; + if (list_count == FILE_EXT_MAX_MEMBERS) { + DEBUG(DBG_ALERT, "The list is too large to export! Exporting only partially\n"); + break; + } } } @@ -319,8 +333,10 @@ void kdfs_file_extent_net_import(struct kdfs_inode *k_inode, struct kdfs_netinod } DEBUG(DBG_INFO, "LIST CONTENTS AFTER IMPORT\n"); - list_for_each_entry(curr, &k_inode->extents_list, list_item) { - DEBUG(DBG_INFO, "#################### f=%lu, l=%lu, o=%d\n", curr->data.page_first, curr->data.page_last, curr->data.extent_owner); + if (!list_empty(&k_inode->extents_list)) { + list_for_each_entry(curr, &k_inode->extents_list, list_item) { + DEBUG(DBG_INFO, "#################### f=%lu, l=%lu, o=%d\n", curr->data.page_first, curr->data.page_last, curr->data.extent_owner); + } } } ----------------------------------------------------------------------- Summary of changes: fs/kdfs/file_extent.c | 58 +++++++++++++++++++++++++++++++----------------- 1 files changed, 37 insertions(+), 21 deletions(-) hooks/post-receive -- kdfs |
From: Marko O. <d0...@us...> - 2010-03-25 16:55:50
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "UNNAMED PROJECT". The branch, master has been updated via 4078b40ab923092c6ef6b49dac3e885bafadbe56 (commit) from 00d7530dbb8e59541120635b9a349954c1c0484e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4078b40ab923092c6ef6b49dac3e885bafadbe56 Author: Marko Obrovac <mar...@in...> Date: Thu Mar 25 18:53:59 2010 +0100 Add the kdfs_stat utility The kdfs_stat lists the extents found in the kdfs meta file as pointed to by the argument passed to it. Modify Makefile accordingly. diff --git a/scripts/Makefile.in b/scripts/Makefile.in index b55c34b..62d9529 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, diff --git a/tools/Makefile.am b/tools/Makefile.am index 4c48a7d..9ccb68d 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -11,7 +11,7 @@ sbindir=$(exec-prefix)/sbin dist_bin_SCRIPTS = krg_legacy_scheduler krgboot_helper krginit_helper -bin_PROGRAMS = migrate checkpoint restart krgadm krgcapset krgcr-run krgboot krginit ipccheckpoint ipcrestart netclient +bin_PROGRAMS = migrate checkpoint restart krgadm krgcapset krgcr-run krgboot krginit ipccheckpoint ipcrestart netclient kdfs_stat sbin_PROGRAMS = mkfs.kdfs INCLUDES = -I@top_srcdir@/libs/include @@ -29,6 +29,7 @@ ipccheckpoint_SOURCES = ipccheckpoint.c ipcrestart_SOURCES = ipcrestart.c mkfs_kdfs_SOURCES = mkfs_kdfs.c netclient_SOURCES = netclient.c +kdfs_stat_SOURCES = kdfs_stat.c EXTRA_DIST = krginit_helper.conf diff --git a/tools/kdfs_stat.c b/tools/kdfs_stat.c new file mode 100644 index 0000000..9eae9fd --- /dev/null +++ b/tools/kdfs_stat.c @@ -0,0 +1,77 @@ +#include <stdio.h> + + +typedef long long loff_t; +typedef unsigned long pgoff_t; +typedef short kdfs_node_t; +typedef unsigned short umode_t; +typedef unsigned int uid_t; +typedef unsigned int gid_t; + +struct timespec { + long tv_sec; + long tv_nsec; +}; + +struct kdfs_physical_inode { + loff_t size; + umode_t mode; + unsigned int nlink; + unsigned long version; + uid_t uid; + gid_t gid; + struct timespec atime; + struct timespec mtime; + struct timespec ctime; +}; + +struct kdfs_file_extent_info { + pgoff_t page_first; /* the first page no owned by a node */ + pgoff_t page_last; /* the last page no owned by a node */ + kdfs_node_t extent_owner; /* the node holding the pages contents */ +}; + + +int main(int argc, char **argv) { + + FILE *f; + struct kdfs_physical_inode kdfs_inode; + struct kdfs_file_extent_info info; + size_t no_extents, rec; + + if( argc == 1 ) { + fprintf( stderr, "Usage: %s <kdfs_meta_file_to_stat>\n", argv[0] ); + return 1; + } + + f = fopen( argv[1], "rb" ); + if( !f ) { + fprintf( stderr, "Error opening file %s.\n", argv[1] ); + return 1; + } + + /* read the kdfs inode info */ + fread( ( void * )&kdfs_inode, sizeof( struct kdfs_physical_inode ), 1, f ); + + if( !feof( f ) ) { + fread( ( void *)&no_extents, sizeof( size_t ), 1, f ); + fprintf( stdout, "Number of extent records found: %d\n\n", ( int )no_extents ); + if( no_extents > 0 ) { + fprintf( stdout, "+-----+---------------------+---------------------+---------------------+------+\n" ); + fprintf( stdout, "| Rec | Frst page in extent | Last page in extent | No of pages in ext | Node |\n" ); + fprintf( stdout, "+-----+---------------------+---------------------+---------------------+------+\n" ); + } + for( rec = 0; rec < no_extents; rec++ ) { + fread( ( void *)&info, sizeof( struct kdfs_file_extent_info ), 1, f ); + fprintf( stdout, "| %3d | %19lu | %19lu | %19lu | %4d |\n", ( int )rec, info.page_first, info.page_last, info.page_last - info.page_first + 1, info.extent_owner ); + } + fprintf( stdout, "+-----+---------------------+---------------------+---------------------+------+\n\n" ); + } else { + fprintf( stdout, "No extents info has been yet registered...\n" ); + } + + fclose( f ); + + return 0; + +} ----------------------------------------------------------------------- Summary of changes: scripts/Makefile.in | 2 +- tools/Makefile.am | 3 +- tools/kdfs_stat.c | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 tools/kdfs_stat.c hooks/post-receive -- UNNAMED PROJECT |
From: Marko O. <d0...@us...> - 2010-03-24 22:25:24
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "kdfs". The branch, make_kdfs_compile has been updated via 1b9e05ab401cc4a857b15868a3097dfe21f43c46 (commit) via 3df2d6d10c565727d1199df459b50de472e7482f (commit) from 42ef403e52c81ccc23988091c27919207a2e8eae (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 1b9e05ab401cc4a857b15868a3097dfe21f43c46 Author: Marko Obrovac <mar...@in...> Date: Wed Mar 24 23:23:21 2010 +0000 Mark kDFS as experimental in Kconfig diff --git a/fs/kdfs/Kconfig b/fs/kdfs/Kconfig index 9bbf605..a65d83c 100644 --- a/fs/kdfs/Kconfig +++ b/fs/kdfs/Kconfig @@ -1,9 +1,9 @@ config KDFS_FS - tristate "kDFS" - depends on KERRIGHED + tristate "kDFS (EXPERIMENTAL)" + depends on KERRIGHED && EXPERIMENTAL default n help Kerrighed/Kernel distributed FS. This is the Distributed Kerrighed file system which tends to exploit node hard drives. - If unsure, say Y. + If unsure, say N. commit 3df2d6d10c565727d1199df459b50de472e7482f Author: Marko Obrovac <mar...@in...> Date: Thu Mar 25 00:14:14 2010 +0100 Separate the retrieval of local and remote mappings diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index cf15936..8ef8f46 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -894,10 +894,17 @@ int content_instantiate(kddm_set_t *kddm_set, void *private_data, int master) DEBUG(DBG_INFO, "K_mapping from the cache\n"); content_data->k_mapping = inode->i_mapping; iput(inode); - } else { - DEBUG(DBG_INFO, "K_mapping will be retrieve from iget\n"); + } else if (inode_linked_node(content_data->ino) == kerrighed_node_id){ + DEBUG(DBG_INFO, "K_mapping will be retrieve from iget - the inode is on this node\n"); inode = kdfs_getinode(k_sb->sb, content_data->ino); content_data->k_mapping = inode->i_mapping; + } else { + DEBUG(DBG_INFO, "K_mapping created from dummy inode info\n"); + inode = new_inode(k_sb->sb); + inode->i_ino = content_data->ino; + insert_inode_hash(inode); + //inode = kdfs_getinode(k_sb->sb, content_data->ino); + content_data->k_mapping = inode->i_mapping; } if (!content_data->k_mapping) DEBUG(DBG_PANIC, "k_mapping was not cleanly initialized\n"); ----------------------------------------------------------------------- Summary of changes: fs/kdfs/Kconfig | 6 +++--- fs/kdfs/address_space.c | 11 +++++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) hooks/post-receive -- kdfs |
From: Marko O. <d0...@us...> - 2010-03-24 15:47:58
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "kdfs". The branch, make_kdfs_compile has been updated via 42ef403e52c81ccc23988091c27919207a2e8eae (commit) from 1f0f458227164acfb67d663065be08f09491824a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 42ef403e52c81ccc23988091c27919207a2e8eae Author: Marko Obrovac <mar...@in...> Date: Wed Mar 24 17:40:48 2010 +0100 Bug fixes Since now pages may overlap between nodes, each time a node writes a page to the disk, it should write from the start of the page in order to ensure that previous commits done by other nodes won't be lost or overwritten. Another small "bugfix" has been applied to kdfs_iol_file_default_owner, where we should check whether kdfs_ilocalfind returned a valid kdfs_inode pointer or not. diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index 8c658b2..cf15936 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -155,7 +155,8 @@ int kdfs_write_begin (struct file *file, return -ENOMEM; *pagep = page; - return __kdfs_prepare_write(file, page, from, from+len); + /* try to write from the beginning of the page (due to possible page overlap) */ + return __kdfs_prepare_write(file, page, 0, from + len); } @@ -220,7 +221,8 @@ int kdfs_write_end(struct file *file, kunmap_atomic(kaddr, KM_USER0); } - __kdfs_commit_write(file, page, from, from+copied); + /* try to write from the beginning of the page */ + __kdfs_commit_write(file, page, 0, from + copied); unlock_page(page); page_cache_release(page); diff --git a/fs/kdfs/file.c b/fs/kdfs/file.c index 45a7835..a6dab7a 100644 --- a/fs/kdfs/file.c +++ b/fs/kdfs/file.c @@ -266,6 +266,8 @@ kerrighed_node_t kdfs_iol_file_default_owner (kddm_set_t *kddm_set, struct kdfs_inode *k_inode = kdfs_ilocalfind(my_data->ino); + ASSERT(k_inode); + // check who's the default owner of the object !!! //ret_val = inode_linked_node(k_inode->inode->i_ino); ret_val = kdfs_file_extent_get_page_owner(k_inode, objid); ----------------------------------------------------------------------- Summary of changes: fs/kdfs/address_space.c | 6 ++++-- fs/kdfs/file.c | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) hooks/post-receive -- kdfs |
From: Marko O. <d0...@us...> - 2010-03-23 18:30:21
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "kdfs". The branch, make_kdfs_compile has been updated via 1f0f458227164acfb67d663065be08f09491824a (commit) from b9f153b7b2db538c971c01212c17ac82a024ca6c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 1f0f458227164acfb67d663065be08f09491824a Author: Marko Obrovac <mar...@in...> Date: Tue Mar 23 20:25:21 2010 +0100 Implement kdfs_file_extent_read_from_file Still some issues to solve. Namely, there are two calls issued to kdfs_getindoe. In one case the info is read correctly, in the other there's no obvious way to do it (for now at least) diff --git a/fs/kdfs/file_extent.c b/fs/kdfs/file_extent.c index e786cb4..74f0af8 100644 --- a/fs/kdfs/file_extent.c +++ b/fs/kdfs/file_extent.c @@ -10,6 +10,7 @@ */ #include "file_extent.h" +#include "super.h" #include "physical_fs.h" #include "debug_kdfs.h" @@ -202,7 +203,7 @@ kdfs_node_t kdfs_file_extent_get_page_owner(struct kdfs_inode *k_inode, pgoff_t size_t kdfs_file_extent_dump_to_file(struct kdfs_inode *k_inode, struct file *file) { - int list_count = 0; + size_t list_count = 0; int bytes_written = 0; struct kdfs_file_extent *curr; @@ -213,7 +214,7 @@ size_t kdfs_file_extent_dump_to_file(struct kdfs_inode *k_inode, struct file *fi } bytes_written += kdfs_phys_write(file, (char *) &(list_count), - sizeof(int), &file->f_pos); + sizeof(size_t), &file->f_pos); list_for_each_entry(curr, &k_inode->extents_list, list_item) { bytes_written += kdfs_phys_write(file, @@ -225,8 +226,50 @@ size_t kdfs_file_extent_dump_to_file(struct kdfs_inode *k_inode, struct file *fi } -size_t kdfs_file_extent_read_from_file(struct kdfs_inode *k_inode, struct file *file) +size_t kdfs_file_extent_read_from_file(struct kdfs_inode *k_inode) { + struct file *file = NULL; + char *phys_filename = NULL; + struct kdfs_physical_inode phys_inode; + size_t no_extents = 0, index; + struct kdfs_file_extent_info record; + struct kdfs_file_extent *new_extent, *curr; + + /* Retrieve the inode meta file */ + phys_filename = kmalloc(PATH_MAX, GFP_KERNEL); + kdfs_getphysicalpath(k_inode->inode->i_sb->s_fs_info, k_inode->inode->i_ino, phys_filename); + strcat(phys_filename, "/" KDFS_INODE_FILENAME); + + file = open_phys_file(phys_filename, O_RDONLY, 0644, 0, 0); + if (!IS_ERR(file)) { + /* re-read the kdfs_physical_inode part of the meta file */ + kdfs_phys_read(file, (char *)&(phys_inode), sizeof(struct kdfs_physical_inode), &file->f_pos); + /* read the number of elements */ + kdfs_phys_read(file, (char *)&(no_extents), sizeof(size_t), &file->f_pos); + /* now, read the extents list */ + for(index = 0; index < no_extents; index++) { + kdfs_phys_read(file, (char *)&(record), sizeof(struct kdfs_file_extent_info), &file->f_pos); + new_extent = kmalloc(sizeof(struct kdfs_file_extent), GFP_KERNEL); + new_extent->data.page_first = record.page_first; + new_extent->data.page_last = record.page_last; + new_extent->data.extent_owner = record.extent_owner; + list_add_tail(&new_extent->list_item, &k_inode->extents_list); + } + close_phys_file(file); + } else { + DEBUG(DBG_ALERT, + "Can't access to the KDFS inode %ld\n" + "Please verify type of the partition %s, it should be a KDFS one", + k_inode->inode->i_ino, ((struct kdfs_super_block*)k_inode->inode->i_sb->s_fs_info)->k_opt->part_name); + } + + kfree(phys_filename); + + DEBUG(DBG_INFO, "\n\n\nLIST CONTENTS AFTER READ\n"); + list_for_each_entry(curr, &k_inode->extents_list, list_item) { + DEBUG(DBG_INFO, "#################### f=%lu, l=%lu, o=%d\n", curr->data.page_first, curr->data.page_last, curr->data.extent_owner); + } + return 0; } diff --git a/fs/kdfs/file_extent.h b/fs/kdfs/file_extent.h index 1832994..1597a5e 100644 --- a/fs/kdfs/file_extent.h +++ b/fs/kdfs/file_extent.h @@ -24,7 +24,7 @@ int kdfs_file_extent_set_page_owner(struct kdfs_inode *k_inode, pgoff_t page_no, kdfs_node_t kdfs_file_extent_get_page_owner(struct kdfs_inode *k_inode, pgoff_t page_no); size_t kdfs_file_extent_dump_to_file(struct kdfs_inode *k_inode, struct file *file); -size_t kdfs_file_extent_read_from_file(struct kdfs_inode *k_inode, struct file *file); +size_t kdfs_file_extent_read_from_file(struct kdfs_inode *k_inode); void kdfs_file_extent_net_export(struct kdfs_inode *k_inode, struct kdfs_netinode *net_inode); void kdfs_file_extent_net_import(struct kdfs_inode *k_inode, struct kdfs_netinode *net_inode); diff --git a/fs/kdfs/inode.c b/fs/kdfs/inode.c index f263215..92efd40 100644 --- a/fs/kdfs/inode.c +++ b/fs/kdfs/inode.c @@ -1147,10 +1147,12 @@ int kdfs_iol_inode_first_touch(kddm_obj_t *objEntry, * Can happen when a content associated kddm set has been instantiated */ k_inode->inode = ilookup(k_sb->sb, objid); - if (k_inode->inode) + if (k_inode->inode) { iput(k_inode->inode); - else + } else { k_inode->inode = kdfs_getinode(k_sb->sb, objid); + kdfs_file_extent_read_from_file(k_inode); + } k_inode->flags = K_INODE_OK; } ----------------------------------------------------------------------- Summary of changes: fs/kdfs/file_extent.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++--- fs/kdfs/file_extent.h | 2 +- fs/kdfs/inode.c | 6 ++++-- 3 files changed, 51 insertions(+), 6 deletions(-) hooks/post-receive -- kdfs |
From: alebre <al...@us...> - 2010-03-22 14:53:17
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "kdfs". The branch, make_kdfs_compile has been updated via b9f153b7b2db538c971c01212c17ac82a024ca6c (commit) from bd020c813b463aeb6c30eb078ab75bed96007ac7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b9f153b7b2db538c971c01212c17ac82a024ca6c Author: alebre <alebre@krgserver.dirty.world> Date: Sun Mar 21 21:05:06 2010 +0000 [JANITORING] Start to work on a usefull readme diff --git a/fs/kdfs/README b/fs/kdfs/README index 72242c9..83a9b7c 100644 --- a/fs/kdfs/README +++ b/fs/kdfs/README @@ -1,13 +1,149 @@ -Adrien - March 27th, 2007 +March, 22th 2010 -3 kind of containers are exploited : -INODE: to provide the distributed cache of inodes inode.* -DIR: to manage and access to KDFS directory content dir.* -FILE: to manage and access to KDFS file content file.* +kDFS aims at providing an integrated cluster file system for High Performance +Computing. + +Based on several concepts suggested in KerFS (Kerrighed 1.02), the kernel +Distributed File system has been develop from scratch. One of the main idea +consists in developing a distributed file system pluggable under the VFS and +only based on the KDDM component of Kerrighed (a DSM at kernel level). +The KDDM features are used to build a cooperative cache for both data and +meta-data using all available memory in the cluster. + +kDFS OVERVIEW - kDFS PARTITION +- - - - - - - - - - - - - - - - +Usage: mkfs.kdfs local_directory_path root_node_id + +The invocation of 'mkfs.kdfs /mnt/local/kdfs-partition 1' creates the following +arborescence: +ls -al /mnt/local/kdfs-partition/ +total 2068 +drwxr-xr-x 3 root root 4096 Mar 11 18:48 . +drwxr-xr-x 4 root root 4096 Mar 11 18:48 .. +drwxr-xr-x 3 root root 4096 Mar 11 18:48 1 +-rw-r--r-- 1 root root 2097162 Mar 11 18:48 .sb + +whereas: +.sb contains the kdfs super bloc informations +1 is the directory containing the entries managed by node 1. +The entries are sorted by packet of one hundred. + +For instance the root entry can be : +ls -al /mnt/local/kdfs-partition/1/0-99/1/. +total 16 +drwxr-xr-x 2 root root 4096 Mar 11 18:48 . +drwxr-xr-x 4 root root 4096 Mar 16 18:40 .. +-rw-r--r-- 1 root root 4096 Mar 16 18:40 .content +-rw-r--r-- 1 root root 80 Mar 16 18:40 .meta + +Each kDFS entry is composed of one '.meta' and several '.content' files. The +.meta saves the meta-informations of one entry (a directory or a file) and is +stored on the node where the entry has been created. +The .content files save the content (the different pages) of one entry. They +can be spread throught the whole cluster according to the striping policy (in +that case, one .content file is used for each node storing some pages of the +entry). + +kDFS EXAMPLE +- - - - - - - - - - - - - - - - +Let's have a look to the following example involving 2 nodes: + +on node 1: +mkfs.kdfs /mnt/local/kdfs-partition-1 1 +# create the kdfs partition and the root entry +# (/mnt/local/kdfs-partition/1/0-99/1) +mount -t kdfs /mnt/local/kdfs-partition-1 /mnt/kdfs +touch /mnt/kdfs/foo +# create a new entry (/mnt/local/kdfs-partition/1/0-99/2) +ls -al /mnt/local/kdfs-partition-1/1/0-99/2/. +total 16 +drwxr-xr-x 2 root root 4096 Mar 16 18:40 . +drwxr-xr-x 4 root root 4096 Mar 16 18:40 .. +-rw-r--r-- 1 root root 6 Mar 16 18:40 .content +-rw-r--r-- 1 root root 80 Mar 16 18:40 .meta + +on node 2: +mkfs.kdfs /mnt/local/kdfs-partition-2 1 +mount -t kdfs /mnt/local/kdfs-partition-2 /mnt/kdfs +ls -al /mnt/local/kdfs-partition-2 +total 2068 +drwxr-xr-x 3 root root 4096 Mar 16 17:49 . +drwxr-xr-x 4 root root 4096 Mar 16 17:49 .. +drwxr-xr-x 3 root root 4096 Mar 16 17:49 2 +-rw-r--r-- 1 root root 2097162 Mar 16 17:49 .sb +# As we are on node 2, we do not yet have any entry which are managed by node 1 +ls -al /mnt/local/kdfs-partition-2/2/0-99/ +total 8 +drwxr-xr-x 2 root root 4096 Mar 16 17:49 . +drwxr-xr-x 3 root root 4096 Mar 16 17:49 .. +# and no entry has been yet created too. +echo "1234" > /mnt/kdfs/foo +# We write 4 bytes from node 2 into a file managed by node 1 +# as a consequence, a .content file is created on the local partition. +ls -al /mnt/local/kdfs-partition-2/1/0-99/2 +total 12 +drwxrwxrwx 2 root root 4096 Mar 16 17:50 . +drwxr-xr-x 4 root root 4096 Mar 16 17:50 .. +-rw-r--r-- 1 root root 4 Mar 16 17:50 .content + +USING kDFS FROM A DISKLESS NODE +- - - - - - - - - - - - - - - - + +Please consider that kDFS can be exploited from a diskless node by specifying +the diskless argument +%% TODO : give an example + +kDFS INTERNALS +- - - - - - - - - - - - - - - - + +the kDFS code is divided into two parts : + tools: KERRIGHED_SRC_PATH/tools/tools/mkfs_kdfs + kernel: KERRIGHED_SRC_PATH/kernel/fs/kdfs + + +Physical representation of one kDFS inode (): +struct kdfs_physical_inode { + loff_t size; + umode_t mode; + unsigned int nlink; + unsigned long version; + uid_t uid; + gid_t gid; + struct timespec atime; + struct timespec mtime; + struct timespec ctime; +}; + +A physical representation of kDFS inode is required. First, to protect kDFS +consistency (direct manipulations on the native FS inodes will not impact on +the kDFS structure). Second, since we exploit a '...' file for storing +meta-informations (directory entries, object localisation, ...). We simply +cannont exploit nlink native value. Directly using native inodes make inode +management harder and uglier :p + +Physical representation of one kDFS dir_entry: +struct kdfs_dir_entry { + + /* data on disk */ + __u16 rec_len; /* Directory entry length */ + ino_t ino; /* ino number */ + __u8 name_len; /* Filename length */ + char name[KDFS_NAME_LEN]; /* Filename */ + + /* mode is also added in the dir_entry + * to improve readdir efficiency */ + umode_t mode; /* File mode */ + +}; + + +SUPERBLOCK MANAGEMENT: +- - - - - - - - - - - - - - - - + +INODE MANAGEMENT: +- - - - - - - - - - - - - - - - + +CONTENT MANAGEMENT (DIR AND PAGES): +- - - - - - - - - - - - - - - - -Theses files have been coded on the following scheme: -The first part of the file concerns traditionnal operations, the second part -concerns the 'linker' interface and the third one concerns the 'IO-linker' -part. -The distributed cache of dentry will be implemented in a second phase. ----------------------------------------------------------------------- Summary of changes: fs/kdfs/README | 156 ++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 146 insertions(+), 10 deletions(-) hooks/post-receive -- kdfs |