From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753668AbcESCG7 (ORCPT ); Wed, 18 May 2016 22:06:59 -0400 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:40910 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751906AbcESCG6 (ORCPT ); Wed, 18 May 2016 22:06:58 -0400 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: iamjoonsoo.kim@lge.com X-Original-SENDERIP: 10.177.222.138 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Date: Thu, 19 May 2016 11:07:22 +0900 From: Joonsoo Kim To: Thomas Garnier Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Andrew Morton , "Paul E . McKenney" , Pranith Kumar , David Howells , Tejun Heo , Johannes Weiner , David Woodhouse , Petr Mladek , Kees Cook , Linux-MM , LKML , Greg Thelen , kernel-hardening@lists.openwall.com Subject: Re: [RFC v1 2/2] mm: SLUB Freelist randomization Message-ID: <20160519020722.GC10245@js1304-P5Q-DELUXE> References: <1463594175-111929-1-git-send-email-thgarnie@google.com> <1463594175-111929-3-git-send-email-thgarnie@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 18, 2016 at 12:12:13PM -0700, Thomas Garnier wrote: > I thought the mix of slab_test & kernbench would show a diverse > picture on perf data. Is there another test that you think would be > useful? Single thread testing on slab_test would be meaningful because it also touch the slowpath. Problem is just unstable result of slab_test. You can get more stable result of slab_test if you repeat same test sometimes and get average result. Please use following slab_test. It will do each operations 100000 times and repeat it 50 times. https://github.com/JoonsooKim/linux/blob/slab_test_robust-next-20160509/mm/slab_test.c I did a quick test for this patchset and get following result. - Before (With patch and randomization is disabled by config) Single thread testing ===================== 1. Kmalloc: Repeatedly allocate then free test 100000 times kmalloc(8) -> 42 cycles kfree -> 67 cycles 100000 times kmalloc(16) -> 43 cycles kfree -> 68 cycles 100000 times kmalloc(32) -> 47 cycles kfree -> 72 cycles 100000 times kmalloc(64) -> 54 cycles kfree -> 78 cycles 100000 times kmalloc(128) -> 75 cycles kfree -> 87 cycles 100000 times kmalloc(256) -> 84 cycles kfree -> 111 cycles 100000 times kmalloc(512) -> 82 cycles kfree -> 112 cycles 100000 times kmalloc(1024) -> 86 cycles kfree -> 113 cycles 100000 times kmalloc(2048) -> 113 cycles kfree -> 127 cycles 100000 times kmalloc(4096) -> 151 cycles kfree -> 154 cycles - After (With patch and randomization is enabled by config) Single thread testing ===================== 1. Kmalloc: Repeatedly allocate then free test 100000 times kmalloc(8) -> 51 cycles kfree -> 68 cycles 100000 times kmalloc(16) -> 57 cycles kfree -> 70 cycles 100000 times kmalloc(32) -> 70 cycles kfree -> 75 cycles 100000 times kmalloc(64) -> 95 cycles kfree -> 84 cycles 100000 times kmalloc(128) -> 142 cycles kfree -> 97 cycles 100000 times kmalloc(256) -> 150 cycles kfree -> 107 cycles 100000 times kmalloc(512) -> 151 cycles kfree -> 107 cycles 100000 times kmalloc(1024) -> 154 cycles kfree -> 110 cycles 100000 times kmalloc(2048) -> 230 cycles kfree -> 124 cycles 100000 times kmalloc(4096) -> 423 cycles kfree -> 165 cycles It seems that performance decreases a lot but I don't care about it because it is a security feature and I don't have a better idea. Thanks.