Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752854AbcCKNFy (ORCPT ); Fri, 11 Mar 2016 08:05:54 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:34092 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752540AbcCKNFq convert rfc822-to-8bit (ORCPT ); Fri, 11 Mar 2016 08:05:46 -0500 MIME-Version: 1.0 In-Reply-To: References: <14d02da417b3941fd871566e16a164ca4d4ccabc.1457519440.git.glider@google.com> Date: Fri, 11 Mar 2016 14:05:45 +0100 Message-ID: Subject: Re: [PATCH v5 2/7] mm, kasan: SLAB support From: Alexander Potapenko To: Andrey Ryabinin Cc: Andrey Konovalov , Christoph Lameter , Dmitry Vyukov , Andrew Morton , Steven Rostedt , Joonsoo Kim , JoonSoo Kim , Kostya Serebryany , kasan-dev , LKML , "linux-mm@kvack.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1500 Lines: 54 On Fri, Mar 11, 2016 at 12:47 PM, Andrey Ryabinin wrote: > 2016-03-09 14:05 GMT+03:00 Alexander Potapenko : > >> +struct kasan_track { >> + u64 cpu : 6; /* for NR_CPUS = 64 */ > > What about NR_CPUS > 64 ? After a discussion with Dmitry we've decided to drop |cpu| and |when| at all, as they do not actually help debugging. This way we'll make kasan_track only 8 bytes (4 bytes for PID, 4 bytes for stack handle). Then the meta structures will be smaller and have nice alignment: struct kasan_track { u32 pid; depot_stack_handle_t stack; }; struct kasan_alloc_meta { struct kasan_track track; u32 state : 2; /* enum kasan_state */ u32 alloc_size : 30; u32 reserved; /* we can use it to store an additional stack handle, e.g. for debugging RCU */ }; struct kasan_free_meta { /* This field is used while the object is in the quarantine. * Otherwise it might be used for the allocator freelist. */ void **quarantine_link; struct kasan_track track; }; >> + u64 pid : 16; /* 65536 processes */ >> + u64 when : 42; /* ~140 years */ >> +}; >> + -- Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Straße, 33 80636 München Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg