All of lore.kernel.org
 help / color / mirror / Atom feed
* Question on readahead of znodes under low RAM
@ 2016-12-24 20:39 Dušan Čolić
  2016-12-26 18:31 ` Edward Shishkin
  0 siblings, 1 reply; 2+ messages in thread
From: Dušan Čolić @ 2016-12-24 20:39 UTC (permalink / raw)
  To: reiserfs-devel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-12-26 18:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-24 20:39 Question on readahead of znodes under low RAM Dušan Čolić
2016-12-26 18:31 ` Edward Shishkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.