Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp864986imm; Fri, 14 Sep 2018 07:30:21 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYM+GppofqcT9mGeB3HMWOlRufqTI5zky0YKPq6z6C0H4udGaPkEkkw7/emz/z/Suq/tLWL X-Received: by 2002:a17:902:6b05:: with SMTP id o5-v6mr12709683plk.338.1536935421004; Fri, 14 Sep 2018 07:30:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536935420; cv=none; d=google.com; s=arc-20160816; b=M+XKqj/Qeu0EZLGnXX48tD05IFpuPrPR0mwmAW9TCdSX+hEXDiqcls4XBbAKc+a244 2JRxz2YTZOc+MFHDYPrmZhNSovYyA6hAvo8WnOBfzRslQXxa8fB2RhtnFkoW6jK7WpoL nVeCwxtXdahc388obwUO702nBqERZ2HJKXW9jFldiL9FG2DAwXJhbTHim4Vlas472SXv f1SlbgTqFJAmwdsF1DC+PioHQ5G9Okva2EzuIginfL7UC+ZCWnREy8UGG2JjHqy8Rr6o uKBbk4Zj/uG3OrAesP/C2SW3wOgXoWsEyq87QLaW7arVaSpJbvzssdac0ad2cRylcp0p 8t6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:subject:message-id:date:from :mime-version:dkim-signature; bh=FFRItDvzVPpEoVFnlYZmcCL2Aa7cUqzuLZZ0kzdpTDw=; b=DRx/nsJBPtRLxPEHO/T3w1vp7zWpqLn/3PMYh0cWPPwfMBTMkVhzgc5sBfggHQIcHZ ZO9XYkXfffsKEINCaazrN9D92+WZI02e7LBPfyA2efIHBqFHAyS4Fz1ZQa/9FKL3po5N WOuytqRzKth/uhVIOjPAUdJ2sraDJlHj85i7XEXLdyb9qP6+PqRAzQTQutMQw5iOpLV6 hNDBc4ACRt0MLPzSqSeIKNm25tO8cevbgDIbxhvAHljjsvjZXwlC93/Yu93vSAjLDTRu U0yHpFi/r4PfLN7wk9kIIac3UpYFIwAM9eGXHmUXjv+mOrdNL68s2Q2fkE1Y/1IFKICM 2uLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fE8TAZD4; 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 p61-v6si7307326plb.55.2018.09.14.07.30.05; Fri, 14 Sep 2018 07:30:20 -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=fE8TAZD4; 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 S1728239AbeINTnA (ORCPT + 99 others); Fri, 14 Sep 2018 15:43:00 -0400 Received: from mail-vs1-f49.google.com ([209.85.217.49]:35877 "EHLO mail-vs1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727818AbeINTm7 (ORCPT ); Fri, 14 Sep 2018 15:42:59 -0400 Received: by mail-vs1-f49.google.com with SMTP id z19-v6so552203vso.3 for ; Fri, 14 Sep 2018 07:28:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=FFRItDvzVPpEoVFnlYZmcCL2Aa7cUqzuLZZ0kzdpTDw=; b=fE8TAZD4WW4tMrYTWhiGwC2vxIBj8Ng549iTvjqJZp++p8wkuuIAB5sATZq18/Hnfk GQej7jGhxo6b5OcHJyWGnR46oemnC/BbFKiK2W4fpDTBZBlkA4l3zZq+kaIsR+rdRDZ3 bL91fZhTGcx1/Y3rCOoaJ2Kvc7qoY5BRhtf1t7BbDudFQOv3nVF0V4V7HdOJlZ5But3q FKH9DiTqPmCE+2pJs66ybRJy8mEhBXQgjc/63+IUc1t90qsnwn7YZyi4OUAVbTAFCOA4 Oh+1k2OyET9l3ca4E5TX++Tz59MLusuazjoGIneT1rVcwDtowm8qAG4vHaglaREm2oBL dm8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=FFRItDvzVPpEoVFnlYZmcCL2Aa7cUqzuLZZ0kzdpTDw=; b=SbXmlnLu3vftR12jeVzupVK/8EMCZSBej52Cdo09+TuRW/2JQ/Q+at2fNJYO8WDWQV 0gjhgwws6rvj1YQe1ZTY8jBUXOO5usA3m6liNpjWs4CjY1HGv+48t0eRBnJv+K29fXzj qf9nQBFx2FdLh+f1pRZ4tLkwkkD1ydLS7XopIeSiEq4Z9fG+zBfVp+THAJ5h91eN0nCL veY6v8t5Zw7LgZ3C7BOd6A/piLFlPaJ9WIlI+iHDtLzJcOwyFTC4fNhk5SvK/d9lwvhO 8fTRHDtB7WSQvIQmDoKaHQc3Aud7RUyxUlzTeTMFIM2AbFb5gy856g8QBbp53vpk3LUk NX4A== X-Gm-Message-State: APzg51BO/XdyWd1bh4tif+PrMPUhtweI6guZ8y8n/TxHoTOVlIOYjW5q 0/Ls48z4SFC4ZdVGjWRDI0Gs5/ItEvaXEaiOwVeL0OzA X-Received: by 2002:a67:a958:: with SMTP id s85-v6mr4434792vse.48.1536935293341; Fri, 14 Sep 2018 07:28:13 -0700 (PDT) MIME-Version: 1.0 From: Pintu Kumar Date: Fri, 14 Sep 2018 19:58:01 +0530 Message-ID: Subject: KSM not working in 4.9 Kernel To: 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 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