From patchwork Thu Dec 12 00:26:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 22265 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f70.google.com (mail-qe0-f70.google.com [209.85.128.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5B117202E6 for ; Thu, 12 Dec 2013 00:26:44 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id 6sf14544944qea.5 for ; Wed, 11 Dec 2013 16:26:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=ZvKBZOBfKj+gaXcYQn+9yNANAioQ806Miw0KjadD3sc=; b=Ka8D3gI21jsRVzRi+VrbNwFSZn1bIEsF9p+J1Mu69CNqjCqR1ZWciVEg0MNkP0sPgZ WnHfiZbBWLkw0ePNKxWlKQMjiP/Eqq1YHAMa7mz/lYBsy3p64AoHc+l+HdAhK7hnTxLK 3uaBINiDhjn0RikgGxBujzUWeA5J1jtXNvensopv5fUQvlDMSE8O38oDWl5Img4ZvqRo KoOWAxD03FJvQdsnbXOuXA5jzwLL1chcgtNptP63jQJhQlQv7NRBGxlRTzi5QV12Impj lTbLOf7SZSvKX9OKuqNJOwnHAmhI1hmHCJwop9nnFc4nAPQc71Rml6rLXZ1Mhre68YnZ p4Nw== X-Gm-Message-State: ALoCoQlrM9UWpXZRD3K8odAASCptMZ5vM4TN2BbAQgzCrV+mrc2VbqIwLIgaYO6OADYl+0fc+PIu X-Received: by 10.58.46.36 with SMTP id s4mr1660075vem.18.1386808003430; Wed, 11 Dec 2013 16:26:43 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.48.105 with SMTP id k9ls266836qen.96.gmail; Wed, 11 Dec 2013 16:26:43 -0800 (PST) X-Received: by 10.58.44.72 with SMTP id c8mr1829780vem.37.1386808003224; Wed, 11 Dec 2013 16:26:43 -0800 (PST) Received: from mail-vb0-f42.google.com (mail-vb0-f42.google.com [209.85.212.42]) by mx.google.com with ESMTPS id we7si6997946vcb.82.2013.12.11.16.26.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Dec 2013 16:26:43 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.42 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.42; Received: by mail-vb0-f42.google.com with SMTP id w5so2223036vbf.29 for ; Wed, 11 Dec 2013 16:26:43 -0800 (PST) X-Received: by 10.52.253.103 with SMTP id zz7mr1001786vdc.70.1386808003096; Wed, 11 Dec 2013 16:26:43 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp313420vcz; Wed, 11 Dec 2013 16:26:42 -0800 (PST) X-Received: by 10.43.17.196 with SMTP id qd4mr3763515icb.44.1386808002105; Wed, 11 Dec 2013 16:26:42 -0800 (PST) Received: from mail-pb0-f49.google.com (mail-pb0-f49.google.com [209.85.160.49]) by mx.google.com with ESMTPS id ya10si14902142pab.327.2013.12.11.16.26.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Dec 2013 16:26:42 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.49 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.160.49; Received: by mail-pb0-f49.google.com with SMTP id jt11so10940537pbb.22 for ; Wed, 11 Dec 2013 16:26:41 -0800 (PST) X-Received: by 10.68.12.138 with SMTP id y10mr6232197pbb.101.1386808001610; Wed, 11 Dec 2013 16:26:41 -0800 (PST) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id nw11sm45404479pab.13.2013.12.11.16.26.40 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Dec 2013 16:26:41 -0800 (PST) From: John Stultz To: Dhaval Giani , Minchan Kim Cc: John Stultz Subject: [PATCH 1/3] volatile-test: Fix purge flag bug Date: Wed, 11 Dec 2013 16:26:26 -0800 Message-Id: <1386807988-20278-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.42 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch from Minchan fixes a bug with the purge flag logic, where we end up overwriting the purge value with whatever the last call returns. Instead we should OR the results together to see if any data was purged. Signed-off-by: John Stultz --- volatile-test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/volatile-test.c b/volatile-test.c index 7f0599c..a25c564 100644 --- a/volatile-test.c +++ b/volatile-test.c @@ -100,7 +100,6 @@ int main(int argc, char *argv[]) vaddr = malloc(FULLSIZE); } - purged = 0; vaddr += PAGE_SIZE-1; vaddr -= (long)vaddr % PAGE_SIZE; @@ -116,8 +115,11 @@ int main(int argc, char *argv[]) printf("Generating %i megs of pressure\n", pressure); generate_pressure(pressure); + purged = 0; for(i=0; i < CHUNKNUM; ) { - mnovolatile(vaddr + (i*CHUNK), CHUNK, &purged); + int tmp_purged = 0; + mnovolatile(vaddr + (i*CHUNK), CHUNK, &tmp_purged); + purged |= tmp_purged; i+=2; }