lkml.org 
[lkml]   [2022]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH v6 7/9] mm: multigenerational lru: eviction
    Date
    ...

    +static int isolate_folios(struct lruvec *lruvec, struct scan_control *sc, int swappiness,
    > + int *type_scanned, struct list_head *list)
    > +{
    > + int i;
    > + int type;
    > + int scanned;
    > + int tier = -1;
    > + DEFINE_MIN_SEQ(lruvec);
    > +
    > + VM_BUG_ON(!seq_is_valid(lruvec));
    > +
    > + /*
    > + * Try to make the obvious choice first. When anon and file are both
    > + * available from the same generation, interpret swappiness 1 as file
    > + * first and 200 as anon first.
    > + */
    > + if (!swappiness)
    > + type = 1;
    > + else if (min_seq[0] < min_seq[1])
    > + type = 0;
    > + else if (swappiness == 1)
    > + type = 1;
    > + else if (swappiness == 200)
    > + type = 0;
    > + else
    > + type = get_type_to_scan(lruvec, swappiness, &tier);
    > +

    Wondering wether it will make it simpler to use
    #define ANON 0
    #define FILE 1

    and then
    else if (min_seq[ANON] < min_seq[FILE])
    type = ANON;

    The usage of 0/1 across code do confuse

    -aneesh

    \
     
     \ /
      Last update: 2022-01-11 11:40    [W:2.855 / U:0.044 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site