From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1769CC5519F for ; Thu, 12 Nov 2020 19:45:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6289920759 for ; Thu, 12 Nov 2020 19:45:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="rKHdDyXn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6289920759 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B482C6B0036; Thu, 12 Nov 2020 14:45:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AF7936B005C; Thu, 12 Nov 2020 14:45:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9BF0A6B0068; Thu, 12 Nov 2020 14:45:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0132.hostedemail.com [216.40.44.132]) by kanga.kvack.org (Postfix) with ESMTP id 6C2336B0036 for ; Thu, 12 Nov 2020 14:45:31 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 1977D3626 for ; Thu, 12 Nov 2020 19:45:31 +0000 (UTC) X-FDA: 77476795662.03.coal81_400f8b927309 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id EB4B228A4E8 for ; Thu, 12 Nov 2020 19:45:30 +0000 (UTC) X-HE-Tag: coal81_400f8b927309 X-Filterd-Recvd-Size: 4608 Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Thu, 12 Nov 2020 19:45:30 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id i26so5090330pgl.5 for ; Thu, 12 Nov 2020 11:45:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tUsjnJsE70MPGpys5UT1OEoJSxFeQtN6aLTMo3hfEjk=; b=rKHdDyXn6oy67dBTpOqWUs9smSJZlYHldHIVXW792bY88duJKOdd/NkTFB1d9HduJh P7Mf3B8aMHapHeIsfXPwxlINzYZn7DBii1N/WZDxfDADxzU94FU9xvanoou6XfEHZCjr whOOUFtVeiU0pmGOfojKOAhlF1sylbgR4v1J5V9xRPdS19rJQZxIqGDxRFUzZbC5opox W9uUvJxCeWfLX61dhfLmvQJl3jLwWBBLzRO8p8+woJeBg+gkiJF4ilo75Gwm6mpqinCN ApVM1EuWvnU9jDx23PEYN6g7Y0WYHKXOX64Y6Ap6CoCZCt76JGnCsAl0q8+9Nkjt9TWt R12w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tUsjnJsE70MPGpys5UT1OEoJSxFeQtN6aLTMo3hfEjk=; b=QYaiFHoj3/FiAPlgCxMrFkpRfvKJ0s7GiiFnrRRNZiu7IPfulAFtJdc/jb90XlyDzb A8X/+dBd2D6sRGoQfdbdYyy3gMlPdlptdOlYwlL+08pRnMLMCcALWwSAJJ+Vtg5IOgg1 EuHtqykRjuy4G5k290q7etCekFKc2+6eIYub0FMTf8X+B9dGqmHU+Kraznk7GWam6GJu jCztSjwHQFNEUHGFdODgKIrFSuyuuaxHJ+dpEwPCqKvVg/J/HsM7jbwEfvGKtkeRXIoz 6qvtLNaByiabwlw2DXt5xGpX7lxFSqP7HAfEcFR65eyGq5Mcvi3QZnshc80BztZWj38D +l8w== X-Gm-Message-State: AOAM533nlAcEPzhEwyfUDjc5Nddn027cDm5f0sVvRCeHw4+dZn9kcQnx l448985AD3Rcrog4SwAL4U25O6VX+OKRWbFsqRLBqw== X-Google-Smtp-Source: ABdhPJymqAxJryKKC0ktlr8u0WBlSEAGCjBRalcMM6ulBX9LDg37qw1ly1XhtUHYBUIPWFyPX+Fs5wEsiV0gSU3nLUM= X-Received: by 2002:a05:6a00:16c4:b029:162:bf9f:6458 with SMTP id l4-20020a056a0016c4b0290162bf9f6458mr947513pfc.55.1605210329356; Thu, 12 Nov 2020 11:45:29 -0800 (PST) MIME-Version: 1.0 References: <0a9b63bff116734ab63d99ebd09c244332d71958.1605046662.git.andreyknvl@google.com> <20201111174902.GK517454@elver.google.com> In-Reply-To: <20201111174902.GK517454@elver.google.com> From: Andrey Konovalov Date: Thu, 12 Nov 2020 20:45:18 +0100 Message-ID: Subject: Re: [PATCH v2 10/20] kasan: inline and rename kasan_unpoison_memory To: Marco Elver Cc: Dmitry Vyukov , Alexander Potapenko , Catalin Marinas , Will Deacon , Vincenzo Frascino , Evgenii Stepanov , Andrey Ryabinin , Branislav Rankov , Kevin Brodsky , Andrew Morton , kasan-dev , Linux ARM , Linux Memory Management List , LKML Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Nov 11, 2020 at 6:49 PM Marco Elver wrote: > > On Tue, Nov 10, 2020 at 11:20PM +0100, Andrey Konovalov wrote: > > Currently kasan_unpoison_memory() is used as both an external annotation > > and as an internal memory poisoning helper. Rename external annotation to > > kasan_unpoison_data() and inline the internal helper for hardware > > tag-based mode to avoid undeeded function calls. > > I don't understand why this needs to be renamed again. The users of > kasan_unpoison_memory() outweigh those of kasan_unpoison_slab(), of > which there seems to be only 1! The idea is to make kasan_(un)poison_memory() functions inlinable for internal use. It doesn't have anything to do with the number of times they are used. Perhaps we can drop the kasan_ prefix for the internal implementations though, and keep using kasan_unpoison_memory() externally. > So can't we just get rid of kasan_unpoison_slab() and just open-code it > in mm/mempool.c:kasan_unpoison_element()? That function is already > kasan-prefixed, so we can even place a small comment there (which would > also be an improvement over current interface, since > kasan_unpoison_slab() is not documented and its existence not quite > justified). We can, but this is a change unrelated to this patch.