From owner-freebsd-arm@FreeBSD.ORG Thu May 12 14:13:25 2011 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 966F8106566C for ; Thu, 12 May 2011 14:13:25 +0000 (UTC) (envelope-from marktinguely@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4A2728FC1B for ; Thu, 12 May 2011 14:13:24 +0000 (UTC) Received: by ywf7 with SMTP id 7so660834ywf.13 for ; Thu, 12 May 2011 07:13:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=W1FHpC+UX+X7IJa94fTEdrqHGhQZ/AC5tgI2XYd1xM4=; b=ZZTL5ey8+UgEKySVnlniZIvINjRaCfRWB3VcHdPTU4RAOvA9SIMDCC6vXU8VSsvh7e DsDPwf6bdGX4YKuRybPifpanyCyiDK5G8jqLHg+oIz1gNAqXUhLEWpSQbp+8aWNsspsJ h5OnyUKEEGyXaLdSnzww5FO4H3GeFpxNMhc6Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=NaR+PjAjoNjo9Qwq2u/KDcZVND6RJDolhnR7LlxE5KeZfZEQ4k+nkHdS1jokmw6Bn7 OHL8ZQ4oL/B/Q2BO+kJ4DrLFVXYwc3qc6Jqv5bK+lQ7K/yNIJZ77d4If6p3oIFlaBMXz HRDuK0TZwHZmvwIo6t/CwVcHLeP5w408rQrBw= Received: by 10.100.211.13 with SMTP id j13mr140708ang.111.1305209604470; Thu, 12 May 2011 07:13:24 -0700 (PDT) Received: from [192.168.1.111] (173-19-151-200.client.mchsi.com [173.19.151.200]) by mx.google.com with ESMTPS id d17sm820481ann.39.2011.05.12.07.13.23 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 12 May 2011 07:13:23 -0700 (PDT) Message-ID: <4DCBEB00.3040608@gmail.com> Date: Thu, 12 May 2011 09:13:20 -0500 From: Mark Tinguely User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: =?UTF-8?B?0JLQu9Cw0LTQuNC80LjRgCDQpNC10YnQtdC90LrQvg==?= References: <578421305188959@web64.yandex.ru> In-Reply-To: <578421305188959@web64.yandex.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: freebsd-arm@freebsd.org Subject: Re: S3C2440A strange perfomance issue X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 14:13:25 -0000 On 5/12/2011 3:29 AM, Владимир Фещенко wrote: > %cc -O0 -o test test.c > > and execute it: > > Code: > > %/usr/bin/time -l ./test > 120.16 real 119.44 user 0.16 sys > 12177 involuntary context switches > > time of execution is over 120 sec ... but after system reboot: > > Code: > > %/usr/bin/time -l ./test > 2.85 real 2.55 user 0.25 sys > 292 involuntary context switches > > execution time is 2.85(!) sec, but it's not all! > > Code: > > %cat test> /dev/null > > %/usr/bin/time -l ./test > 120.40 real 119.51 user 0.23 sys > 12201 involuntary context switches > > Once the file has been opened for reading (cat test> /dev/null), execution time again increased to 120 sec (until the next reboot). > > What is it?! Sounds like the executable cache gets disabled on the executable page that is also writable issue that we talked about year or so ago. If you want a quick test, in pmap_fix_cache(), and exit the routine immediately if the mapping is executable. I did some tracing, and there are cases where this is not the correct solution - executable mappings that are really shared and cache should be disabled. I have a idea level patch for this but never tested it well enough. I also notice a huge jump in "involuntary context switch" counts in your runs. --Mark Tinguely