title: How to set a page's flag in kernel?
body: <p>Assume I want to set a page dirty in kernel, can I just emulate it like this:</p>
  
  <pre><code>#define PG_dirty 4
  struct page page1;
  page1.flags |= (1 &lt;&lt; PG_dirty);
  </code></pre>
  
  <p>Then this page is marked dirty?
  I see there is a macro in <code>&lt;mm.h&gt;</code></p>
  
  <pre><code>#define SetPageDirty(page)      set_bit(PG_dirty, &amp;(page)-&gt;flags)
  </code></pre>
  
  <p>It seems that <code>set_bit</code> does a lot more things.</p>