Question on readahead of znodes under low RAM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



znode.c line 618:

/* zload with readahead */
int zload_ra(znode * node /* znode to load */ , ra_info_t * info)
{
int result;
assert("nikita-484", node != NULL);
assert("nikita-1377", znode_invariant(node));
assert("jmacd-7771", !znode_above_root(node));
assert("nikita-2125", atomic_read(&ZJNODE(node)->x_count) > 0);
assert("nikita-3016", reiser4_schedulable());
if (info)
formatted_readahead(node, info);
result = jload(ZJNODE(node));
assert("nikita-1378", znode_invariant(node));
return result;
}
/* load content of node into memory */
int zload(znode *node)
{
return zload_ra(node, NULL);
}


readahead.c line 39:

#define LOW_MEM_PERCENTAGE (5)
static int low_on_memory(void)
{
unsigned int freepages;
freepages = nr_free_pages();
return freepages < (totalram_pages * LOW_MEM_PERCENTAGE / 100);
}
/* start read for @node and for a few of its right neighbors */
void formatted_readahead(znode * node, ra_info_t *info)
{
struct formatted_ra_params *ra_params;
znode *cur;
int i;
int grn_flags;
lock_handle next_lh;
/* do nothing if node block number has not been assigned to node (which
* means it is still in cache). */
if (reiser4_blocknr_is_fake(znode_get_block(node)))
return;
ra_params = get_current_super_ra_params();
if (znode_page(node) == NULL)
jstartio(ZJNODE(node));
if (znode_get_level(node) != LEAF_LEVEL)
return;
/* don't waste memory for read-ahead when low on memory */
if (low_on_memory())
return;


So how is znode loaded when free RAM is < 5%?

Dushan
--
To unsubscribe from this list: send the line "unsubscribe reiserfs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux File System Development]     [Linux BTRFS]     [Linux NFS]     [Linux Filesystems]     [Ext4 Filesystem]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Resources]

  Powered by Linux