1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>tag_pages_for_writeback</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="The Linux Kernel API"><link rel="up" href="ch04s03.html" title="More Memory Management Functions"><link rel="prev" href="API-balance-dirty-pages-ratelimited.html" title="balance_dirty_pages_ratelimited"><link rel="next" href="API-write-cache-pages.html" title="write_cache_pages"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">tag_pages_for_writeback</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-balance-dirty-pages-ratelimited.html">Prev</a> </td><th width="60%" align="center">More Memory Management Functions</th><td width="20%" align="right"> <a accesskey="n" href="API-write-cache-pages.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-tag-pages-for-writeback"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>tag_pages_for_writeback — 2 tag pages to be written by write_cache_pages 3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <b class="fsfunc">tag_pages_for_writeback </b>(</code></td><td>struct address_space * <var class="pdparam">mapping</var>, </td></tr><tr><td> </td><td>pgoff_t <var class="pdparam">start</var>, </td></tr><tr><td> </td><td>pgoff_t <var class="pdparam">end</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1124788780"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>mapping</code></em></span></dt><dd><p> 4 address space structure to write 5 </p></dd><dt><span class="term"><em class="parameter"><code>start</code></em></span></dt><dd><p> 6 starting page index 7 </p></dd><dt><span class="term"><em class="parameter"><code>end</code></em></span></dt><dd><p> 8 ending page index (inclusive) 9 </p></dd></dl></div></div><div class="refsect1"><a name="idp1124792444"></a><h2>Description</h2><p> 10 This function scans the page range from <em class="parameter"><code>start</code></em> to <em class="parameter"><code>end</code></em> (inclusive) and tags 11 all pages that have DIRTY tag set with a special TOWRITE tag. The idea is 12 that write_cache_pages (or whoever calls this function) will then use 13 TOWRITE tag to identify pages eligible for writeback. This mechanism is 14 used to avoid livelocking of writeback by a process steadily creating new 15 dirty pages in the file (thus it is important for this function to be quick 16 so that it can tag pages faster than a dirtying process can create them). 17</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-balance-dirty-pages-ratelimited.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch04s03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-write-cache-pages.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">balance_dirty_pages_ratelimited</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">write_cache_pages</span></td></tr></table></div></body></html> 18