<div>Hi All,</div>
<div> </div>
<div>I finally got the solution to the hang problem.</div>
<div>To make it run as ramdisk,</div>
<div> </div>
<div>In function valid_swap_request function I have removed the check for 1 page, i enabled multiple pages, </div>
<div>The problem here was some pages are being coalesce so pages which are on common bondary will be made to one bio request, in the present compcache code, as it is made for swap subsystem so it only works for PAGE_SIZE, </div>

<div>I have added this check as </div>
<div> </div>
<div>static inline int valid_swap_request(struct bio *bio)<br>{<br> if (unlikely(<br>   (bio-&gt;bi_sector &gt;= (compcache.disksize &gt;&gt; SECTOR_SHIFT)) ||<br>   (bio-&gt;bi_sector &amp; (SECTORS_PER_PAGE - 1)) ||<br>
   (bio-&gt;bi_size &amp; (PAGE_SIZE - 1))))<br>   {<br>   printk(&quot;Invalid Request\n&quot;);<br>   return 0;<br>   }<br> return 1;<br>}<br> </div>
<div>In the function compcache_make_request function i added </div>
<div> </div>
<div> bio_for_each_segment( bv, bio, i )<br>{<br> page = bv-&gt;bv_page;<br> page_no = ((bio-&gt;bi_sector &gt;&gt; SECTORS_PER_PAGE_SHIFT) + i);<br>{</div>
<div>... /* Switch Loop */</div>
<div>}</div>
<div> </div>
<div>To complete the page copy we do </div>
<div> </div>
<div>  set_bit(BIO_UPTODATE, &amp;bio-&gt;bi_flags);<br>  BIO_ENDIO(bio, 0);<br>  return 0;<br></div>
<div>I have changed the compat.h</div>
<div> </div>
<div>#if LINUX_VERSION_CODE &lt;= KERNEL_VERSION(2,6,23)<br>#define BIO_IO_ERROR(bio) bio_io_error(bio, PAGE_SIZE)<br>#define BIO_ENDIO(bio, error) bio_endio(bio, bio-&gt;bi_vcnt*PAGE_SIZE, error)<br>#else<br>#define BIO_IO_ERROR(bio) bio_io_error(bio)<br>
#define BIO_ENDIO(bio, error) bio_endio(bio, error)<br>#endif<br><br>Doing this works fine for my x86  system. </div>
<div> </div>
<div>But still there is one more problem it still does not work for ext2 file system. I will get the solution and let you know about it.</div>
<div> </div>
<div>Sincere Regards</div>
<div>Vijayendra Suman</div>
<div> </div>
<div> </div>
<div> </div>
<div class="gmail_quote">On Fri, Jul 10, 2009 at 1:22 PM, Vijayendra Suman <span dir="ltr">&lt;<a href="mailto:vijayendra.suman@gmail.com">vijayendra.suman@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi <br><br>I am sorry for the typo <br>
<div class="im">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid"><span style="COLOR: rgb(204,0,0)">Bonnie -d 32 /mnt -s 50 &amp; sync # Bonnie process hangs</span></blockquote>
</div>
<div><br><span style="COLOR: rgb(204,0,0)">Bonnie -d /mnt -s 50 &amp; sync # Bonnie process hangs<br></span> <br>Sincere Regards<br><font color="#888888">Vijayendra Suman<br></font></div>
<div>
<div></div>
<div class="h5"><br>
<div class="gmail_quote">On Fri, Jul 10, 2009 at 12:08 PM, Vijayendra Suman <span dir="ltr">&lt;<a href="mailto:vijayendra.suman@gmail.com" target="_blank">vijayendra.suman@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Hi John, Nitin,<br><br>I think i have not explained well about the method for the hang.<br><br>
1) insmod xvmalloc.ko; # I use 0.5.3 version<br>2) insmod lzo-faster.ko; # I use a modified form of compressor, this helps me to boot my application faster.<br>We can try this same by inserting compressor and decompressor modules which is given in the compcache release. <br>
3) insmod compcache.ko;<br>
<ul>
<li> State 1</li></ul>
<div style="MARGIN-LEFT: 40px">mkfs.ext3 /dev/ramzswap0<br>mount -t ext3 /dev/ramzswap0 /mnt;<br>Bonnie -d 32 /mnt -s 50 &amp; sync # works well no problem<br></div>
<ul>
<li>State 2</li></ul>
<div style="MARGIN-LEFT: 40px">mkfs.vfat /dev/ramzswap0<br>mount /dev/ramzswap0 /mnt;<br><span style="COLOR: rgb(204,0,0)">Bonnie -d 32 /mnt -s 50 &amp; sync # Bonnie process hangs</span><br><br>If a application hangs it is a problem; which needs to be checked why this happens.<br>
</div>
<ul>
<li>State 3 # Boot Kernel 2.6.30; <br></li></ul>
<div style="MARGIN-LEFT: 40px">mkfs.vfat /dev/ramzswap0<br>mount /dev/ramzswap0 /mnt;<br>Bonnie -d 32 /mnt -s 50 &amp; sync # works well no problem</div><br>I will try to find the issue and let you know<br><br>Sincere Regards<br>
<font color="#888888">Vijayendra Suman</font> 
<div>
<div></div>
<div><br><br><br><br>
<div class="gmail_quote">On Fri, Jul 10, 2009 at 11:46 AM, Nitin Gupta <span dir="ltr">&lt;<a href="mailto:nitingupta910@gmail.com" target="_blank">nitingupta910@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Hi Vijayendra, 
<div><br><br>On 07/10/2009 10:57 AM, Vijayendra Suman wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid"><br>My main motive is not to run the compcache block node as a swap partition. I would like to use this partition for shared memory. My application has to do lot of IPC&#39;s but i do not have much memory on board so i have decided to use compcache block device node as a generalized block device.<br>
<br></blockquote></div>How about this:<br> - Create a small tmpfs partition, say 64MB and create filesystem over this.<br> - Create ramzswap device (probably with a backing_swap) with memlimit of say, 1GB.<br><br>This extra level of indirection using tmpfs effectively gives the same effect as a &#39;generic ramzswap device&#39;.<br>
I think this is what John suggested. 
<div><br><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Also I have checked formatting this node with some block as ext3, this works perfectly well.<br>
With ext2 it is having some issue i will look in to it, But with fat 16, 32 I see a hang in the system which is a result of the analysis i have done. I will let you know f i find some thing.<br><br>   1) swapon /dev/ramzswap<br>
   2) mount -t tmpfs -o size=1G,nr_inodes=10k,mode=0700 tmpfs /space<br><br><br>I do not want it as swap partition<br><br></blockquote><br></div>I cannot think of any other method than tmpfs+ramzswap for your case.<br><font color="#888888"><br>
Nitin<br><br></font></blockquote></div><br></div></div></blockquote></div><br></div></div></blockquote></div><br>