Happy Coding & Testing Process

After third week, we started coding and made basic things. Our first aim to enable read-only ptes for collapsing. I still look for this issue. Something goes wrong and I can't see what is that.

To test my changes I've prepared test programs. They create pressure on memory and supply to swapped out system. Actually, they are very basic, just make malloc(), read/write operations on memory. memtest and stress are very strong workload programs, but to swapped out something they mix operations which are not correct for me. I should test specific conditions so use my test programs and they will be sophisticated later on.

To get informations about what happened with my changes, I use smem which shows swap usage percentage, pid, ppid with -t -p options and that's enough for me :). For specific process I look /proc/pid/smaps it gives anonhugepages/anonymouspages numbers and swap usage.

To look kernel messages we can use dmesg, but its size is not enough for me :) because I've been testing almost every line of the functions. To increase size of dmesg log, you should should set CONFIG_LOG_BUF_SHIFT in kernel config file. However When I setted it by 27 which means 2^27 bytes, make seems that doesn't accept this number! Probably, the number can be 16 or 17 as suggestion of config, but I'm not sure about that. Then I've looked /var/log/kern.log, and its size enough for me :) I'm sure about test results with it.

do_swap_page() makes swapped in operations afterward khugepaged scans the pages tables that come from do_swap_page(). There is no function call for khugepaged_scan_mm_slot(), it is called per 10000 miliseconds. Its call chain is like that:
khugepaged_scan_mm_slot() -> khugepaged_scan_pmd() -> collapse_huge_page() ->

Today I've realized in khugepaged_scan_pmd(), ptes seem unpresent! but they are swapped in. Then I need to look do_swap_page() again :).

16 Ocak 2015

Posted In: coding, Gezegen, internship, kernel, khugepaged, linux, smem, stress, testing

WordPress, php-rss reader ve simpleXML üzerine

Şu aralar YDÜ-IBM innovasyon merkeziyle haşır neşir yollarda seyyah misali dolaşıyorken web temelli bir projede içerik yönetim sistemi içine başka bir kaynaktan rss çekip göstermek gerekti, php5 ile birlikte gelen aşağıda bir örneğini gördüğünüz simpleXML’i kullanayım dedim.

$rss =  simplexml_load_file('http://erdinc.neu.edu.tr/?feed=rss2&cat=8');
$title =  $rss->channel->title;
foreach ($rss->channel->item as $item) {
  echo "<a href='" . $item->link . "'>" . $item->title . "</a>";
  echo "<p>" . $item->content . "</p>";}

Buraya kadar her şey normal ancak wordpress “Description” tag’ın da belirli bir karakter sayısından sonra feed içine […] kokuyor. Dönüp wordpress koduna baktıktan sonra bu işi en kısa yoldan aşağıdaki gibi çözebilirim diye düşündüm. Böylelikle simpleXML’de kısıtlama olmayan içeriği çok rahat alabildim.

--- wp-includes/feed-rss2.php.org   2008-06-10 03:08:48.000000000 +0300
+++ wp-includes/feed-rss2.php       2008-06-10 03:45:25.000000000 +0300
@@ -43,9 +43,9 @@
<?php else : ?>
                <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
        <?php if ( strlen( $post->post_content ) > 0 ) : ?>
-               <content:encoded><![CDATA[<?php the_content() ?>]]></content:encoded>
+               <content><![CDATA[<?php the_content() ?>]]></content>
        <?php else : ?>
-               <content:encoded><![CDATA[<?php the_excerpt_rss() ?>]]></content:encoded>
+               <content><![CDATA[<?php the_excerpt_rss() ?>]]></content>

Belki bir gün birini işine yarar, şimdilik google’ın tozlu raflarından birine yerleşsin :)

10 Haziran 2008

Posted In: coding, lkd, php, rss, wordpress

WP Twitter Auto Publish Powered By : XYZScripts.com