Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp615630pxb; Thu, 12 Nov 2020 11:47:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8AkpYcjY6hHejDHLOdNPuug//p6RVDwTn2XubIwy7vxgH1J4o/xy6xitLi24t2uuk/J9L X-Received: by 2002:a50:a6d0:: with SMTP id f16mr1499045edc.135.1605210454614; Thu, 12 Nov 2020 11:47:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605210454; cv=none; d=google.com; s=arc-20160816; b=SubqGgPHw3qL+Nf6NMBJIaEU4lIk5djeqYc9tsAu4KYimtC83m1CMr42OBAApinb79 KfQpronS3sp83uiq8tNNCp4XXlKnmvFP0/6rgGw3LeiNYsHfXYycrAdJFZOOh1X218nR j9I0gZRIOytRK70tE3t2k/Gza2N5vXU7iMdVVhfjxuR/RDARVZUwg5Gh0xnh3thrr2dF cY0RgnelQubyu3b5zg4gOxvvcvbSH+Jf5GhK5baA/vRlhgGuC8/IAwmdemtnUCnFUNZ7 ioLDdd2zxnyvNff7UtM0a2wK/pwRwK+KMmw6Qtq87kDzLpG4nTB+kFWleUYPRCzCHbqR XIYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=tUsjnJsE70MPGpys5UT1OEoJSxFeQtN6aLTMo3hfEjk=; b=KBzIEpw9o4rhvMxf7pgdNhghqSDAltWXz6gDNBfjh6RD6WRazACG8SGR8DR7YjQmq6 r9LYLrzl5RTs+/O2UWm8IVgDSC2fOCD7cIR534f50T0RIzCTiyhWXxFbtaYSpE3bsI51 Tae6kZ2F3FD9LzGGUtA9kcQae0dcvggV7bzaTo4oPksq38QipNAvI9Gc3xtPhKfuthza Oo8PWBtJiQINk/rLzPi7nFLiz06X8o7TxBetJkU/scxC0JIw/RLszDb+/VoblxGuKpfn qQzyNTkGBX7cRo09CGCvRZTXTL2cwl3LwRg/zzg2d6JoKzUFERt54QqU4y4TsWD8eVHc ctVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=rKHdDyXn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c5si4616290edw.91.2020.11.12.11.47.10; Thu, 12 Nov 2020 11:47:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=rKHdDyXn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726743AbgKLTpa (ORCPT + 99 others); Thu, 12 Nov 2020 14:45:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726310AbgKLTpa (ORCPT ); Thu, 12 Nov 2020 14:45:30 -0500 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20C96C0613D1 for ; Thu, 12 Nov 2020 11:45:30 -0800 (PST) Received: by mail-pg1-x541.google.com with SMTP id i7so5088629pgh.6 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=SfdQJWpSFuSSlk19E5xS80LOWsc6sl9wyD94IUbcpQbJdnUNAtkqijjFpBCpl5U0X8 6FlR/vgscnP0ytGiKB0XNPRKf/x1734XjCqchak/w1T9AdSE5lOleyi0fTFPyfU0x3FH neF+6toHpAy2BDMJfOl0sl6fKQqS0Ddvz9hnaAvMF+NpnS2+C2rPU9QCXtWgJkTOobX9 Ssp8NbXcLVKWAl9al27GMwJUEWX6yhkvBLwWAK3PYmXlUxdZtjJ00SmDkymSuLfCriDq iwx4X1fTp5x+wmA4Md1uzn1II0bx10X8In34h+lLrze6cIhySGkqP+DhriKyUvq6wZqg 39kA== X-Gm-Message-State: AOAM530iB+OczJ2tl+mJ4WB7cZjMZ552M70CPgcGPqX6xuGCT1cZ5QgR pjvsIm6Nbqa+pmHLCHZ+WJiTNvBhxMO9Ch3BfpL0hQ== 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.