From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot0-f200.google.com (mail-ot0-f200.google.com [74.125.82.200]) by kanga.kvack.org (Postfix) with ESMTP id E80586B027C for ; Wed, 15 Nov 2017 19:44:20 -0500 (EST) Received: by mail-ot0-f200.google.com with SMTP id b49so8971360otj.11 for ; Wed, 15 Nov 2017 16:44:20 -0800 (PST) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id 109sor8059858otc.156.2017.11.15.16.44.19 for (Google Transport Security); Wed, 15 Nov 2017 16:44:19 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <1510715958-9174-1-git-send-email-kyeongdon.kim@lge.com> From: "Figo.zhang" Date: Thu, 16 Nov 2017 08:44:18 +0800 Message-ID: Subject: Re: [PATCH v2] ksm : use checksum and memcmp for rb_tree Content-Type: multipart/alternative; boundary="001a113d0df0a29afe055e0eeb67" Sender: owner-linux-mm@kvack.org List-ID: To: Timofey Titovets Cc: Kyeongdon Kim , Andrew Morton , Andrea Arcangeli , Minchan Kim , broonie@kernel.org, Michal Hocko , Ingo Molnar , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Arvind Yadav , imbrenda@linux.vnet.ibm.com, kirill.shutemov@linux.intel.com, bongkyu.kim@lge.com, Linux MM , Linux Kernel --001a113d0df0a29afe055e0eeb67 Content-Type: text/plain; charset="UTF-8" it seems violate the patent which hold by vmware, the patent is: US 6789156B1 the majority assertion of this patent is that compare the content of 2 pages with HASH/Checksum algorithm in operation system. 2017-11-16 5:25 GMT+08:00 Timofey Titovets : > Reviewed-by: Timofey Titovets > > 2017-11-15 6:19 GMT+03:00 Kyeongdon Kim : > > The current ksm is using memcmp to insert and search 'rb_tree'. > > It does cause very expensive computation cost. > > In order to reduce the time of this operation, > > we have added a checksum to traverse. > > > > Nearly all 'rb_node' in stable_tree_insert() function > > can be inserted as a checksum, most of it is possible > > in unstable_tree_search_insert() function. > > In stable_tree_search() function, the checksum may be an additional. > > But, checksum check duration is extremely small. > > Considering the time of the whole cmp_and_merge_page() function, > > it requires very little cost on average. > > > > Using this patch, we compared the time of ksm_do_scan() function > > by adding kernel trace at the start-end position of operation. > > (ARM 32bit target android device, > > over 1000 sample time gap stamps average) > > > > On original KSM scan avg duration = 0.0166893 sec > > 14991.975619 : ksm_do_scan_start: START: ksm_do_scan > > 14991.990975 : ksm_do_scan_end: END: ksm_do_scan > > 14992.008989 : ksm_do_scan_start: START: ksm_do_scan > > 14992.016839 : ksm_do_scan_end: END: ksm_do_scan > > ... > > > > On patch KSM scan avg duration = 0.0041157 sec > > 41081.46131 : ksm_do_scan_start : START: ksm_do_scan > > 41081.46636 : ksm_do_scan_end : END: ksm_do_scan > > 41081.48476 : ksm_do_scan_start : START: ksm_do_scan > > 41081.48795 : ksm_do_scan_end : END: ksm_do_scan > > ... > > > > We have tested randomly so many times for the stability > > and couldn't see any abnormal issue until now. > > Also, we found out this patch can make some good advantage > > for the power consumption than KSM default enable. > > > > v1 -> v2 > > - add comment for oldchecksum value > > - move the oldchecksum value out of union > > - remove check code regarding checksum 0 in stable_tree_search() > > > > link to v1 : https://lkml.org/lkml/2017/10/30/251 > > > > Signed-off-by: Kyeongdon Kim > > --- > > mm/ksm.c | 48 ++++++++++++++++++++++++++++++++++++++++++++---- > > 1 file changed, 44 insertions(+), 4 deletions(-) > > > > diff --git a/mm/ksm.c b/mm/ksm.c > > index be8f457..9280569 100644 > > --- a/mm/ksm.c > > +++ b/mm/ksm.c > > @@ -134,6 +134,7 @@ struct ksm_scan { > > * @kpfn: page frame number of this ksm page (perhaps temporarily on > wrong nid) > > * @chain_prune_time: time of the last full garbage collection > > * @rmap_hlist_len: number of rmap_item entries in hlist or > STABLE_NODE_CHAIN > > + * @oldchecksum: previous checksum of the page about a stable_node > > * @nid: NUMA node id of stable tree in which linked (may not match > kpfn) > > */ > > struct stable_node { > > @@ -159,6 +160,7 @@ struct stable_node { > > */ > > #define STABLE_NODE_CHAIN -1024 > > int rmap_hlist_len; > > + u32 oldchecksum; > > #ifdef CONFIG_NUMA > > int nid; > > #endif > > @@ -1522,7 +1524,7 @@ static __always_inline struct page *chain(struct > stable_node **s_n_d, > > * This function returns the stable tree node of identical content if > found, > > * NULL otherwise. > > */ > > -static struct page *stable_tree_search(struct page *page) > > +static struct page *stable_tree_search(struct page *page, u32 checksum) > > { > > int nid; > > struct rb_root *root; > > @@ -1550,6 +1552,18 @@ static struct page *stable_tree_search(struct > page *page) > > > > cond_resched(); > > stable_node = rb_entry(*new, struct stable_node, node); > > + > > + /* first make rb_tree by checksum */ > > + if (checksum < stable_node->oldchecksum) { > > + parent = *new; > > + new = &parent->rb_left; > > + continue; > > + } else if (checksum > stable_node->oldchecksum) { > > + parent = *new; > > + new = &parent->rb_right; > > + continue; > > + } > > + > > stable_node_any = NULL; > > tree_page = chain_prune(&stable_node_dup, &stable_node, > root); > > /* > > @@ -1768,7 +1782,7 @@ static struct page *stable_tree_search(struct page > *page) > > * This function returns the stable tree node just allocated on success, > > * NULL otherwise. > > */ > > -static struct stable_node *stable_tree_insert(struct page *kpage) > > +static struct stable_node *stable_tree_insert(struct page *kpage, u32 > checksum) > > { > > int nid; > > unsigned long kpfn; > > @@ -1792,6 +1806,18 @@ static struct stable_node > *stable_tree_insert(struct page *kpage) > > cond_resched(); > > stable_node = rb_entry(*new, struct stable_node, node); > > stable_node_any = NULL; > > + > > + /* first make rb_tree by checksum */ > > + if (checksum < stable_node->oldchecksum) { > > + parent = *new; > > + new = &parent->rb_left; > > + continue; > > + } else if (checksum > stable_node->oldchecksum) { > > + parent = *new; > > + new = &parent->rb_right; > > + continue; > > + } > > + > > tree_page = chain(&stable_node_dup, stable_node, root); > > if (!stable_node_dup) { > > /* > > @@ -1850,6 +1876,7 @@ static struct stable_node > *stable_tree_insert(struct page *kpage) > > > > INIT_HLIST_HEAD(&stable_node_dup->hlist); > > stable_node_dup->kpfn = kpfn; > > + stable_node_dup->oldchecksum = checksum; > > set_page_stable_node(kpage, stable_node_dup); > > stable_node_dup->rmap_hlist_len = 0; > > DO_NUMA(stable_node_dup->nid = nid); > > @@ -1907,6 +1934,19 @@ struct rmap_item *unstable_tree_search_insert(struct > rmap_item *rmap_item, > > > > cond_resched(); > > tree_rmap_item = rb_entry(*new, struct rmap_item, node); > > + > > + /* first make rb_tree by checksum */ > > + if (rmap_item->oldchecksum < > tree_rmap_item->oldchecksum) { > > + parent = *new; > > + new = &parent->rb_left; > > + continue; > > + } else if (rmap_item->oldchecksum > > + > tree_rmap_item->oldchecksum) { > > + parent = *new; > > + new = &parent->rb_right; > > + continue; > > + } > > + > > tree_page = get_mergeable_page(tree_rmap_item); > > if (!tree_page) > > return NULL; > > @@ -2031,7 +2071,7 @@ static void cmp_and_merge_page(struct page *page, > struct rmap_item *rmap_item) > > } > > > > /* We first start with searching the page inside the stable tree > */ > > - kpage = stable_tree_search(page); > > + kpage = stable_tree_search(page, rmap_item->oldchecksum); > > if (kpage == page && rmap_item->head == stable_node) { > > put_page(kpage); > > return; > > @@ -2098,7 +2138,7 @@ static void cmp_and_merge_page(struct page *page, > struct rmap_item *rmap_item) > > * node in the stable tree and add both > rmap_items. > > */ > > lock_page(kpage); > > - stable_node = stable_tree_insert(kpage); > > + stable_node = stable_tree_insert(kpage, > checksum); > > if (stable_node) { > > stable_tree_append(tree_rmap_item, > stable_node, > > false); > > -- > > 2.6.2 > > > > -- > > To unsubscribe, send a message with 'unsubscribe linux-mm' in > > the body to majordomo@kvack.org. For more info on Linux MM, > > see: http://www.linux-mm.org/ . > > Don't email: email@kvack.org > > > > -- > Have a nice day, > Timofey. > > -- > To unsubscribe, send a message with 'unsubscribe linux-mm' in > the body to majordomo@kvack.org. For more info on Linux MM, > see: http://www.linux-mm.org/ . > Don't email: email@kvack.org > --001a113d0df0a29afe055e0eeb67 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
it seems=C2=A0violate=C2=A0the=C2=A0patent which hold by= =C2=A0vmware, the patent is:=C2=A0US 6789156B1the= =C2=A0majority=C2=A0assertion=C2=A0 of this patent=C2=A0is that=C2=A0compar= e the=C2=A0content of 2=C2=A0pages with HASH/Checksum =C2=A0algorithm in op= eration=C2=A0system.
2017-11-16 5:25 GMT+08:00 Timofey Titovets <nefelim4ag@gmail.com>:
Re= viewed-by: Timofey Titovets <nef= elim4ag@gmail.com>

2017-11-15 6:19 GMT+03:00 Kyeongdon Kim <kyeongdon.kim@lge.com>:
> The current ksm is using memcmp to insert and search 'rb_tree'= .
> It does cause very expensive computation cost.
> In order to reduce the time of this operation,
> we have added a checksum to traverse.
>
> Nearly all 'rb_node' in stable_tree_insert() function
> can be inserted as a checksum, most of it is possible
> in unstable_tree_search_insert() function.
> In stable_tree_search() function, the checksum may be an additional. > But, checksum check duration is extremely small.
> Considering the time of the whole cmp_and_merge_page() function,
> it requires very little cost on average.
>
> Using this patch, we compared the time of ksm_do_scan() function
> by adding kernel trace at the start-end position of operation.
> (ARM 32bit target android device,
> over 1000 sample time gap stamps average)
>
> On original KSM scan avg duration =3D 0.0166893 sec
> 14991.975619 : ksm_do_scan_start: START: ksm_do_scan
> 14991.990975 : ksm_do_scan_end: END: ksm_do_scan
> 14992.008989 : ksm_do_scan_start: START: ksm_do_scan
> 14992.016839 : ksm_do_scan_end: END: ksm_do_scan
> ...
>
> On patch KSM scan avg duration =3D 0.0041157 sec
> 41081.46131 : ksm_do_scan_start : START: ksm_do_scan
> 41081.46636 : ksm_do_scan_end : END: ksm_do_scan
> 41081.48476 : ksm_do_scan_start : START: ksm_do_scan
> 41081.48795 : ksm_do_scan_end : END: ksm_do_scan
> ...
>
> We have tested randomly so many times for the stability
> and couldn't see any abnormal issue until now.
> Also, we found out this patch can make some good advantage
> for the power consumption than KSM default enable.
>
> v1 -> v2
> - add comment for oldchecksum value
> - move the oldchecksum value out of union
> - remove check code regarding checksum 0 in stable_tree_search()
>
> link to v1 : https://lkml.org/lkml/2017/10/30/251<= br> >
> Signed-off-by: Kyeongdon Kim <kyeongdon.kim@lge.com>
> ---
>=C2=A0 mm/ksm.c | 48 ++++++++++++++++++++++++++++++++++++++++++++-= ---
>=C2=A0 1 file changed, 44 insertions(+), 4 deletions(-)
>
> diff --git a/mm/ksm.c b/mm/ksm.c
> index be8f457..9280569 100644
> --- a/mm/ksm.c
> +++ b/mm/ksm.c
> @@ -134,6 +134,7 @@ struct ksm_scan {
>=C2=A0 =C2=A0* @kpfn: page frame number of this ksm page (perhaps tempo= rarily on wrong nid)
>=C2=A0 =C2=A0* @chain_prune_time: time of the last full garbage collect= ion
>=C2=A0 =C2=A0* @rmap_hlist_len: number of rmap_item entries in hlist or= STABLE_NODE_CHAIN
> + * @oldchecksum: previous checksum of the page about a stable_node >=C2=A0 =C2=A0* @nid: NUMA node id of stable tree in which linked (may n= ot match kpfn)
>=C2=A0 =C2=A0*/
>=C2=A0 struct stable_node {
> @@ -159,6 +160,7 @@ struct stable_node {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
>=C2=A0 #define STABLE_NODE_CHAIN -1024
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int rmap_hlist_len;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0u32 oldchecksum;
>=C2=A0 #ifdef CONFIG_NUMA
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int nid;
>=C2=A0 #endif
> @@ -1522,7 +1524,7 @@ static __always_inline struct page *chain(struct= stable_node **s_n_d,
>=C2=A0 =C2=A0* This function returns the stable tree node of identical = content if found,
>=C2=A0 =C2=A0* NULL otherwise.
>=C2=A0 =C2=A0*/
> -static struct page *stable_tree_search(struct page *page)
> +static struct page *stable_tree_search(struct page *page, u32 checksu= m)
>=C2=A0 {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int nid;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct rb_root *root;
> @@ -1550,6 +1552,18 @@ static struct page *stable_tree_search(struct p= age *page)
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cond_resc= hed();
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0stable_no= de =3D rb_entry(*new, struct stable_node, node);
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* first make = rb_tree by checksum */
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (checksum &= lt; stable_node->oldchecksum) {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0parent =3D *new;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0new =3D &parent->rb_left;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0continue;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} else if (che= cksum > stable_node->oldchecksum) {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0parent =3D *new;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0new =3D &parent->rb_right;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0continue;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
> +
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0stable_no= de_any =3D NULL;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0tree_page= =3D chain_prune(&stable_node_dup, &stable_node, root);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/*
> @@ -1768,7 +1782,7 @@ static struct page *stable_tree_search(struct pa= ge *page)
>=C2=A0 =C2=A0* This function returns the stable tree node just allocate= d on success,
>=C2=A0 =C2=A0* NULL otherwise.
>=C2=A0 =C2=A0*/
> -static struct stable_node *stable_tree_insert(struct page *kpage)
> +static struct stable_node *stable_tree_insert(struct page *kpage, u32= checksum)
>=C2=A0 {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int nid;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned long kpfn;
> @@ -1792,6 +1806,18 @@ static struct stable_node *stable_tree_insert(s= truct page *kpage)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cond_resc= hed();
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0stable_no= de =3D rb_entry(*new, struct stable_node, node);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0stable_no= de_any =3D NULL;
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* first make = rb_tree by checksum */
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (checksum &= lt; stable_node->oldchecksum) {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0parent =3D *new;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0new =3D &parent->rb_left;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0continue;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} else if (che= cksum > stable_node->oldchecksum) {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0parent =3D *new;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0new =3D &parent->rb_right;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0continue;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
> +
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0tree_page= =3D chain(&stable_node_dup, stable_node, root);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (!stab= le_node_dup) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0/*
> @@ -1850,6 +1876,7 @@ static struct stable_node *stable_tree_insert(st= ruct page *kpage)
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0INIT_HLIST_HEAD(&stable_node_dup->hlist);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0stable_node_dup->kpfn =3D kpfn; > +=C2=A0 =C2=A0 =C2=A0 =C2=A0stable_node_dup->oldchecksum =3D checks= um;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set_page_stable_node(kpage, stable_no= de_dup);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0stable_node_dup->rmap_hlist_l= en =3D 0;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0DO_NUMA(stable_node_dup->nid =3D n= id);
> @@ -1907,6 +1934,19 @@ struct rmap_item *unstable_tree_search_insert(<= wbr>struct rmap_item *rmap_item,
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cond_resc= hed();
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0tree_rmap= _item =3D rb_entry(*new, struct rmap_item, node);
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* first make = rb_tree by checksum */
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (rmap_item-= >oldchecksum < tree_rmap_item->oldchecksum) {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0parent =3D *new;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0new =3D &parent->rb_left;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0continue;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} else if (rma= p_item->oldchecksum
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0> = tree_rmap_item->oldchecksum) {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0parent =3D *new;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0new =3D &parent->rb_right;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0continue;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
> +
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0tree_page= =3D get_mergeable_page(tree_rmap_item);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (!tree= _page)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0return NULL;
> @@ -2031,7 +2071,7 @@ static void cmp_and_merge_page(struct page *page= , struct rmap_item *rmap_item)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* We first start with searching the = page inside the stable tree */
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0kpage =3D stable_tree_search(page);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0kpage =3D stable_tree_search(page, rmap_it= em->oldchecksum);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (kpage =3D=3D page && rmap= _item->head =3D=3D stable_node) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0put_page(= kpage);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return; > @@ -2098,7 +2138,7 @@ static void cmp_and_merge_page(struct page *page= , struct rmap_item *rmap_item)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 * node in the stable tree and add both rmap_items.
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 */
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0lock_page(kpage);
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0stable_node =3D stable_tree_insert(kpage);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0stable_node =3D stable_tree_insert(kpage, checksum);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0if (stable_node) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0stable_tree_append(tree_rma= p_item, stable_node,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 false);
> --
> 2.6.2
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in<= br> > the body to majordomo@kvack.org= .=C2=A0 For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=3Dmailto:"dont@kvack.org"> emai= l@kvack.org </a>



--
Have a nice day,
Timofey.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.= =C2=A0 For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=3Dmailto:"dont@kvack.org"> email@kva= ck.org </a>

--001a113d0df0a29afe055e0eeb67-- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org