参照元†
- PG_uptodate ビットのテスト
- 指定されたページのフラグ(flags メンバ)に
PG_uptodate ビットをセットする。
- このフラグは他の CPU が読み出そうとしている場合があるため、
書き込みメモリバリアが必要。
返り値†
- ページの属性フラグ(PG_xxxx)
- この関数の片割れ(テスト関数)
static inline void SetPageUptodate(struct page *page)
{
#ifdef CONFIG_S390
if (!test_and_set_bit(PG_uptodate, &page->flags))
page_clear_dirty(page);
- FIXME: IBM S/390 の場合は特別な処理が必要なようだが、
理由はわからない。
#else
/*
* Memory barrier must be issued before setting the PG_uptodate bit,
* so that all previous stores issued in order to bring the page
* uptodate are actually visible before PageUptodate becomes true.
*
* s390 doesn't need an explicit smp_wmb here because the test and
* set bit already provides full barriers.
*/
smp_wmb();
set_bit(PG_uptodate, &(page)->flags);
#endif
}
コメント†