Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1042628imm; Fri, 14 Sep 2018 10:12:43 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaclA8PRrHGLuuIMaR+23o2K5TLDYeIwwS6wSeN/fpo1len1HTvaaz6PU2StUKwZsySgoBm X-Received: by 2002:a63:e70e:: with SMTP id b14-v6mr12801458pgi.68.1536945163392; Fri, 14 Sep 2018 10:12:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536945163; cv=none; d=google.com; s=arc-20160816; b=XikrKqtq+9Cp6C4dtEKNgAzeLKVHVplXe9+pBj8bZRgGrBq074Frrwk5+vp8QPKpSO cJlQlEVqXQX5cEWzbif1PGnlZDLuowvIL/cIfb9DbAQ//0AqE+13rMQvYP0CtY9GYL5G G9t2Bko6SZGgN7I7yb9W7w0T+FCkvKqTw5gFTaexA3J/iiVMWWR6vrqlSkOYBWRagJBP jRI40TC+T9ChBJBRybQA19sdhhkgZziax76F41YVVKienVnhG8oqIw4FMBU0PyO2kjvX 7wwXPpoSQXWk0GlOQ71kGztHeOhtqizsbWdAZjlGnMQ23WocJA+r46JnDfElvbsDlOwx cC+A== 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=rzpbwCynHfZ/Xor0x/HIU1nC6Oo+JfxJZnN3D+ikNHs=; b=R+H2ia2LLpnNqMch7Y67GArJcVbGdjUvKAntibPwPT6EvHBPLQgqBDjuzlO5DqIHz2 R63xtnZhj0QC4YfDZVdumhulbju/IUFdUuajNdXHBP4P3wAfyvQvQ1B88fUG4XC9IXUy pHeFJbge59ZG8zf1+wN90OPCceFHPmFND01cQLDgUqnd8RjrGge9Xke5C8GmxT5Za8ts pelzf5MrgnSyI97RVgMdZ4CLndUgvOABX7a5MjElFO8GPs0eZa5JeVOUtzVcuSRJqLGm b4ZbM9OLFmOY0K7jmNKi9a07vsJEoiRXWuheLHY8g2qLhgHYu2za89cXdH4FAuOma4Us 3SAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hkFJgn2e; 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 d6-v6si7256867pgi.506.2018.09.14.10.12.20; Fri, 14 Sep 2018 10:12:43 -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=hkFJgn2e; 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 S1727623AbeINW1i (ORCPT + 99 others); Fri, 14 Sep 2018 18:27:38 -0400 Received: from mail-qt0-f182.google.com ([209.85.216.182]:37092 "EHLO mail-qt0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726947AbeINW1h (ORCPT ); Fri, 14 Sep 2018 18:27:37 -0400 Received: by mail-qt0-f182.google.com with SMTP id n6-v6so9398277qtl.4 for ; Fri, 14 Sep 2018 10:12:14 -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=rzpbwCynHfZ/Xor0x/HIU1nC6Oo+JfxJZnN3D+ikNHs=; b=hkFJgn2eOzU6bqo7ddGqRytrFe1FRYYyrTnPlVd5d3sfH9e6OP+cIfFSwcep7ri6bH dvPGYnUn2mpP5gEdxZ1OaKjOu2HBBvqIKS54YLDUqtclM2iN8FTUzhJWancbhv7IXHyM /PX9scVrZ+TXSnpKLtIcmdwbv3sB9LZsS0prw1QDXj2JF2Q7VuBZbCOTJawhvs+583V0 GI2ZJsIg7YvJOHeO/ZsoIJL37BcMi7KIUjL6IndF3hNtRUQmWwUI6ClrlCAM2gwWUwLL jz+cFUdz2HTObwPZDiGnQLSgqctPzCwOn6tYLFZ50AB0Z079szPi3G54X6gv0dJcOUJi 71dg== 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=rzpbwCynHfZ/Xor0x/HIU1nC6Oo+JfxJZnN3D+ikNHs=; b=nWJzZeSy/37tk9knA8u9Vo+A2kr8jgOcvRYIQa0DzAUjqUyfhnxvFIMPt9yAfOghpO UrTZGIpoPmzFumFBG2Xtg28J2cA6UjpfyMzR/5QWkohfV/RoDGyjJyK957IWir2Gf3Fd Lkp4VxlfSzLJ7+XziL0IeCpwZpX9lFN0Dm/CM+EsLenbZGgj3oL07LC2RIs7p1dIKjqK 5gh/Zri9R6NMPEYQEqqlUkFH90pw6ADTNjX7bMvDsZ2zCvSOjR3TVE7UV3cxCKkhQLZ5 ciyfHbisCRrs9h6APcX0DSKSn0Twt5eDuEU/Kq+aj/GBj98s1AA4ct1W3yiKQzGY/yJg 7Srg== X-Gm-Message-State: APzg51Cd79ebyTaCZxH5lTa6g2ycUi6EQwz94IMW7EenaFfb/w2cf25r bt01CeFsn6XhN7ykEjz6Cd/nFKBEVB2kGx41l0EOsA== X-Received: by 2002:ad4:5052:: with SMTP id m18-v6mr9766707qvq.164.1536945133672; Fri, 14 Sep 2018 10:12:13 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Yang Shi Date: Fri, 14 Sep 2018 10:12:00 -0700 Message-ID: Subject: Re: KSM not working in 4.9 Kernel To: pintu.ping@gmail.com Cc: Linux Kernel Mailing List , linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, Linux MM 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 Hi Pintu, I recall there are some ksm test cases in LTP. Did you try them out? 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 >