Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1484684imm; Fri, 14 Sep 2018 19:55:46 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaQgv3AhU1wmFEfMVGeAwGfb2wfEYycPoAnAb6kdpDdXqtqJVJKZE5jd6+FQTehD2WW48oO X-Received: by 2002:a17:902:8481:: with SMTP id c1-v6mr14788131plo.177.1536980146096; Fri, 14 Sep 2018 19:55:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536980146; cv=none; d=google.com; s=arc-20160816; b=YQ/tqpdY2YS3pYwf2Fus/wc46tKzZVs0q8kp/GIAoCMLRN7FjGHOKMTWEl+BP0OX1Z PWnVYzeXjRlb511r6w6Ushlg/Lri9l36u/65/r71ILl0btu7CyW5dQQtxFBQ4gVyXscn PEdFHIg4ytSgOwdgnvTls+H2rxz/chkTfcQVA9mIPQZdB0UXOIHkHcDrLTvtVgmuGrZq bMTh1c2kODgwG79c7ugN4GNT2WkJhN82qey9hwJjXfyMHGhAlT1WkrZ8AosCTZiisG6L izuEc2/Zqaovnu/tlvFPRynChxVUmWp+rZC0BzZhLyVQ1EMHIs+gcpSpKRd1hDM5enid 2K/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=jcSchzlr5ZtGAg/8Q66D0g7+KhyEozXOxTtB4XaXNcc=; b=DE2upYookdCFH6VSsVqjQGmUaMr7RRiy62+OQeNd2y2L5Iyx94jpP9fnNsAj4uUP+h 4YiCcNlopWgTB/OcJZzvj0czW9pDBwc7cDiGyZfp9lVf6REHP70hYMDKLttADeF76Rma q1+Ys6MdBPWAMKUjpPOop+EdNmg2B+f/PPLMf97oqNmQcJO+nXXr1Eci9JcvME0yD6cR u2F/V5U8LDG9HAkWw4uMfQ7T+Jn1wYVW/pE0CeirnhEMrx1N5wxV5eKYomslLrepMOmf IxF1P2StvGWhcZVY5WKlcmgICJb+5wAzk2tBi6Vn1b7sad3X4y6MTilh0RcrDvYSaOel zUuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sQbmcQ9n; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d37-v6si8829114plb.430.2018.09.14.19.55.30; Fri, 14 Sep 2018 19:55:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sQbmcQ9n; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727029AbeIOIMn (ORCPT + 99 others); Sat, 15 Sep 2018 04:12:43 -0400 Received: from mail-vs1-f67.google.com ([209.85.217.67]:42513 "EHLO mail-vs1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726295AbeIOIMn (ORCPT ); Sat, 15 Sep 2018 04:12:43 -0400 Received: by mail-vs1-f67.google.com with SMTP id s188-v6so1123227vss.9 for ; Fri, 14 Sep 2018 19:55:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jcSchzlr5ZtGAg/8Q66D0g7+KhyEozXOxTtB4XaXNcc=; b=sQbmcQ9nKQrUdC685regrvFVCyBG2xb5erfPoGh0/3qrD0YEpvq7SY8FwORTWGCILc RpBpHy1LONrcmGbLgMTAfKfOKDof1TUmQqsyCslAi82g4JceIXTDotWO9TiwGVVoOD3L Me57LOWEvS5L4k49oGVwXDrvRg3qxc7OFrY1g1+RhPI1mS7wnJco8zpsfsjQmGncmxZg SyRLTuyBcqPXZle5b+YzePfNdTwcIDr9yn4rT1Bk6Sf6lVHRkFQdpcZ2yj6W/kFpuH2K uBPa2+vk4EwJOvxrTIY5QQBCy45HXHTv9A2+vDC+hPPo94ZtoqKeVHUydhPQ3akM7pC8 5xGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jcSchzlr5ZtGAg/8Q66D0g7+KhyEozXOxTtB4XaXNcc=; b=O9U92fMTTdjtWS09PNSM/pb3met7aMYX3SrwC4swN5n+nosi5GEEQeLV+v+8QwblV4 0RumkaEE4bAQjknU8f7orcxPdoI3f7sj5qops4yBoaksLBuJVmwb10epM/mZodXmBSQ/ 3pfLohDBDAqPi+DNMrlipwZzxdBW5+pJDeIKl/DfEcMW5jISqp8FNmmv5URppaUXv9Oa Y1Ex/qgP2eXdl6md4YUiccPEYlc0y+B+rfVeySQMkxtLHWEpcB9aZ3pYDWXtoBHUNVsX KROtS+Uas39Bv13fpmAUEuXpFnYc83XGycixpZD3ncOV6jl/A1Zd7CKICNWXslf5bdfm Eh6Q== X-Gm-Message-State: APzg51DWKteJBWr4zHNsPoDH3hDaG92q6ZG+0685aqo8NYiOhvFOdfDd FPReza9FgUy6GbblMOTarnq0505B4DBnmr91yMo= X-Received: by 2002:a67:850f:: with SMTP id h15-v6mr4795064vsd.26.1536980125226; Fri, 14 Sep 2018 19:55:25 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Pintu Kumar Date: Sat, 15 Sep 2018 08:25:13 +0530 Message-ID: Subject: Re: KSM not working in 4.9 Kernel To: shy828301@gmail.com Cc: open list , Russell King - ARM Linux , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 14 Sep 2018, 10:42 pm Yang Shi, wrote: > > Hi Pintu, > > I recall there are some ksm test cases in LTP. Did you try them out? No. I haven't seen the LTP test. I will check out now. But I wonder what is the problem with my test? > On Fri, Sep 14, 2018 at 7:28 AM Pintu Kumar wrote: > > > > Hi All, > > > > Board: Hikey620 ARM64 > > Kernel: 4.9.20 > > > > I am trying to verify KSM (Kernel Same Page Merging) functionality on > > 4.9 Kernel using "mmap" and madvise user space test utility. > > But to my observation, it seems KSM is not working for me. > > CONFIG_KSM=y is enabled in kernel. > > ksm_init is also called during boot up. > > 443 ? SN 0:00 [ksmd] > > > > ksmd thread is also running. > > > > However, when I see the sysfs, no values are written. > > ~ # grep -H '' /sys/kernel/mm/ksm/* > > /sys/kernel/mm/ksm/pages_hashed:0 > > /sys/kernel/mm/ksm/pages_scanned:0 > > /sys/kernel/mm/ksm/pages_shared:0 > > /sys/kernel/mm/ksm/pages_sharing:0 > > /sys/kernel/mm/ksm/pages_to_scan:200 > > /sys/kernel/mm/ksm/pages_unshared:0 > > /sys/kernel/mm/ksm/pages_volatile:0 > > /sys/kernel/mm/ksm/run:1 > > /sys/kernel/mm/ksm/sleep_millisecs:1000 > > > > So, please let me know if I am doing any thing wrong. > > > > This is the test utility: > > int main(int argc, char *argv[]) > > { > > int i, n, size; > > char *buffer; > > void *addr; > > > > n = 100; > > size = 100 * getpagesize(); > > for (i = 0; i < n; i++) { > > buffer = (char *)malloc(size); > > memset(buffer, 0xff, size); > > addr = mmap(NULL, size, > > PROT_READ | PROT_EXEC | PROT_WRITE, > > MAP_PRIVATE | MAP_ANONYMOUS, > > -1, 0); > > madvise(addr, size, MADV_MERGEABLE); > > sleep(1); > > } > > printf("Done....press ^C\n"); > > > > pause(); > > > > return 0; > > } > > > > > > > > Thanks, > > Pintu > >