From patchwork Thu May 25 15:42:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Marinas X-Patchwork-Id: 100516 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp824233qge; Thu, 25 May 2017 08:42:49 -0700 (PDT) X-Received: by 10.99.100.129 with SMTP id y123mr45327913pgb.217.1495726969686; Thu, 25 May 2017 08:42:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495726969; cv=none; d=google.com; s=arc-20160816; b=otzyRRKSknjUIcfKV2sRzbKRw4O1lb8GD10zDjduz9bW+oKit3rrQkjgHpxUntL/+H q7V8Ws5IPHcIX6mNcljH24JQn0L41bpx6sGzrA5MyqBpuMCmX75SWZ9e0RZ8hA9gnYns 5OYcET1DTHk5/oK/IlRxXIx5V9KWDtAcwn7naV/UjAuw4VOHDV1K2JqOj1zYNhH5SMte lTLjnWoQ1Kh9qPdB8wie+hERGsvKZwYAFyqRL/3YRYjOV+y0SQIMdaqfxcnwCaofJIBl NQECVmJ2e+QbpjB0nATdq52p9VJ4M/DP19bpHHlyFyUe5kRmEfD6CJM7cHe3VSwAsOUE 2+QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=bcbtj5TMY8QV3VjG/1A98vWrjFfVPMKV3+U3WVGZB1w=; b=XyMMRuSGOGD3Ne6WggOjOxaYkH550PtQfniIkidmYufJqKETQu3fJP7qHH8aX6ueA0 EVl9NbOWls6Xdf0I8US4bxi3372b5pUdHr60zzfp2b2O9MkryQ53L9dlI62gfPFkBXEL PVGKs595EAtRUAEWOX9+GL24sjiIrkh8hwuYfqVw1jRw5ausTzMx05wgSioRCJuQYkCx 33yyLU/QZxmOrP7QfhL1LglQRs0MjX0vCcDfcHd48ECbfBSFCp8mIxSeGtqoQbK271oY gLm2zQVrLYy5S6oTFily59+p19/pisXDQAGOf/sw8CuWtJx758obONLKHvUNh2M6fUPq 8oOw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o123si28886685pfb.32.2017.05.25.08.42.49; Thu, 25 May 2017 08:42:49 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S942391AbdEYPm2 (ORCPT + 25 others); Thu, 25 May 2017 11:42:28 -0400 Received: from foss.arm.com ([217.140.101.70]:51354 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938727AbdEYPm1 (ORCPT ); Thu, 25 May 2017 11:42:27 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B00E71596; Thu, 25 May 2017 08:42:26 -0700 (PDT) Received: from e104818-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 783793F41F; Thu, 25 May 2017 08:42:25 -0700 (PDT) From: Catalin Marinas To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Michal Hocko , Andy Lutomirski , "Luis R. Rodriguez" , Andrew Morton Subject: [PATCH v2 1/3] mm: kmemleak: Slightly reduce the size of some structures on 64-bit architectures Date: Thu, 25 May 2017 16:42:15 +0100 Message-Id: <1495726937-23557-2-git-send-email-catalin.marinas@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1495726937-23557-1-git-send-email-catalin.marinas@arm.com> References: <1495726937-23557-1-git-send-email-catalin.marinas@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch changes the kmemleak_object.flags type to unsigned int and moves the early_log.min_count (int) near early_log.op_type (int) to slightly reduce the size of these structures on 64-bit architectures. Cc: Michal Hocko Cc: Andy Lutomirski Cc: "Luis R. Rodriguez" Signed-off-by: Catalin Marinas --- mm/kmemleak.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 20036d4f9f13..964b12eba2c1 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -150,7 +150,7 @@ struct kmemleak_scan_area { */ struct kmemleak_object { spinlock_t lock; - unsigned long flags; /* object status flags */ + unsigned int flags; /* object status flags */ struct list_head object_list; struct list_head gray_list; struct rb_node rb_node; @@ -262,9 +262,9 @@ enum { */ struct early_log { int op_type; /* kmemleak operation type */ + int min_count; /* minimum reference count */ const void *ptr; /* allocated/freed memory block */ size_t size; /* memory block size */ - int min_count; /* minimum reference count */ unsigned long trace[MAX_TRACE]; /* stack trace */ unsigned int trace_len; /* stack trace length */ }; @@ -393,7 +393,7 @@ static void dump_object_info(struct kmemleak_object *object) object->comm, object->pid, object->jiffies); pr_notice(" min_count = %d\n", object->min_count); pr_notice(" count = %d\n", object->count); - pr_notice(" flags = 0x%lx\n", object->flags); + pr_notice(" flags = 0x%x\n", object->flags); pr_notice(" checksum = %u\n", object->checksum); pr_notice(" backtrace:\n"); print_stack_trace(&trace, 4);