The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]



Индекс форумов
Составление сообщения

Исходное сообщение
"Во FreeBSD существенно оптимизированы операции поиска в VFS"
Отправлено Аноним, 30-Июл-20 20:04 
в новостях о Linux вы тоже говорите что там ногами писано - каждый раз когда там что-то улучшили?
* Fast path lookup protected with SMR and sequence counters.
3564           *
3565           * Note: all VOP_FPLOOKUP_VEXEC routines have a comment referencing this one.
3566           *
3567           * Filesystems can opt in by setting the MNTK_FPLOOKUP flag and meeting criteria
3568           * outlined below.
3569           *
3570           * Traditional vnode lookup conceptually looks like this:
3571           *
3572           * vn_lock(current);
3573           * for (;;) {
3574           *      next = find();
3575           *      vn_lock(next);
3576           *      vn_unlock(current);
3577           *      current = next;
3578           *      if (last)
3579           *          break;
3580           * }
3581           * return (current);
3582           *
3583           * Each jump to the next vnode is safe memory-wise and atomic with respect to
3584           * any modifications thanks to holding respective locks.
3585           *
3586           * The same guarantee can be provided with a combination of safe memory
3587           * reclamation and sequence counters instead. If all operations which affect
3588           * the relationship between the current vnode and the one we are looking for
3589           * also modify the counter, we can verify whether all the conditions held as
3590           * we made the jump. This includes things like permissions, mount points etc.
3591           * Counter modification is provided by enclosing relevant places in
3592           * vn_seqc_write_begin()/end() calls.
3593           *
3594           * Thus this translates to:
3595           *
3596           * vfs_smr_enter();
3597           * dvp_seqc = seqc_read_any(dvp);
3598           * if (seqc_in_modify(dvp_seqc)) // someone is altering the vnode
3599           *     abort();
3600           * for (;;) {
3601           *      tvp = find();
3602           *      tvp_seqc = seqc_read_any(tvp);
3603           *      if (seqc_in_modify(tvp_seqc)) // someone is altering the target vnode
3604           *          abort();
3605           *      if (!seqc_consistent(dvp, dvp_seqc) // someone is altering the vnode
3606           *          abort();
3607           *      dvp = tvp; // we know nothing of importance has changed
3608           *      dvp_seqc = tvp_seqc; // store the counter for the tvp iteration
3609           *      if (last)
3610           *          break;
3611           * }
3612           * vget(); // secure the vnode
3613           * if (!seqc_consistent(tvp, tvp_seqc) // final check
3614           *          abort();
3615           * // at this point we know nothing has changed for any parent<->child pair
3616           * // as they were crossed during the lookup, meaning we matched the guarantee
3617           * // of the locked variant
3618           * return (tvp);
 

Ваше сообщение
Имя*:
EMail:
Для отправки ответов на email укажите знак ! перед адресом, например, !user@host.ru (!! - не показывать email).
Более тонкая настройка отправки ответов производится в профиле зарегистрированного участника форума.
Заголовок*:
Сообщение*:
 
При общении не допускается: неуважительное отношение к собеседнику, хамство, унизительное обращение, ненормативная лексика, переход на личности, агрессивное поведение, обесценивание собеседника, провоцирование флейма голословными и заведомо ложными заявлениями. Не отвечайте на сообщения, явно нарушающие правила - удаляются не только сами нарушения, но и все ответы на них. Лог модерирования.



Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру