Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp470839pxb; Wed, 11 Nov 2020 08:10:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJyiLICE8hpag+ex3yWpyKhdONGjfL9xmKsLXF3JlrUc1YwJ1X+wHBtSE45AvNltY6UioGYP X-Received: by 2002:a17:907:1112:: with SMTP id qu18mr25554197ejb.507.1605111020872; Wed, 11 Nov 2020 08:10:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605111020; cv=none; d=google.com; s=arc-20160816; b=Tq7oPq3Jsj2XgmdyfSLbKKXD/JIOHkgmiOm3yHovy7qhqFGpTdMu21iUJo+MSIwrI2 0MDdeXYSH0E6n250A15bjilkznNm0VRCdgvaGKtQGP1+lHrk6+Q98jEV68ckUMtb997N rXAyVQK3kh2RNrMuobjn/FCxq7r1Trik/uL5KH9gEID7Bke2Wto/hMYnC0XHxGLYePXm dcpw0qj+AGGcMeRddPj921aSdFYXYfVgqmelmrvPqDmYGLEQTHjXxygDy3r+EvLYicr4 0nlSpJvibuCK3gYccmliuwRoQYIcselWMhZMoSUV9rYWI+a+JK8WXZw+XpPBX+crcc4i CfeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=JOTPMrM9cXc3gHfHHUUOqsLEtBpDW5NPaRavY4aCrIo=; b=Nb/pr4tTaoAJ8i6hf6Lctozq1qfN0CCezETuH3lRNqFgpKUjdyEthC/brMd7V7rXZC qVUWoDSK3vSvZEaMm8wc3I/vDLpVrR8OWBwDGfURBfcVm85sItNj/4tVq5GVfVmPexR8 RBFh3T9zJXKlJMdvUF/PiLsDGKlpksPEA5XCgWTQ5Lu5zWeTRISMtKLE9FF+FNSTmNxZ nS/smPbghJWQfYwLFgLvt6b6xh8dSe/RkZICzPBqdIaDLX/hX6LTd1B7pOLH877zJv5N 8lfT3RoNe0J1ZFYXAtkpCCdNVBlBDC/tEuCbPmGFNRSilBcMnFCADEX47lxRlobe5HuU Idyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=QM4oYuC5; 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 q11si1530981ejb.550.2020.11.11.08.09.57; Wed, 11 Nov 2020 08:10:20 -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=QM4oYuC5; 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 S1725966AbgKKQIa (ORCPT + 99 others); Wed, 11 Nov 2020 11:08:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725860AbgKKQI2 (ORCPT ); Wed, 11 Nov 2020 11:08:28 -0500 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E13AC0613D1 for ; Wed, 11 Nov 2020 08:08:28 -0800 (PST) Received: by mail-wr1-x442.google.com with SMTP id p1so3018384wrf.12 for ; Wed, 11 Nov 2020 08:08:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=JOTPMrM9cXc3gHfHHUUOqsLEtBpDW5NPaRavY4aCrIo=; b=QM4oYuC5Dv5jC1hneMgwO9I5PEumNL2bgDxUI+JJdMVCTuBTGTxF1SCYZV/00TgpOU jyL6y9Z4jttTYmROYsPvh/wz16cfpFGnzGyFnhes84Lei6yYH0jCsSHpI5AR6kxkiqc7 ik18Y1bJ2FU5OQb8nz3f86wdDO3U+7w3dRViajfiHsrAzOjefbtM0uIJrPGin+syNTV+ 9tSmfDS7PNPRRnCPHUaQd0t15xRK+vJhg5Ny98KUKXbyEPq/pn7iRHU/oVOlJAUVLbmb eXZRZtTjweiRyy2RaB6eE3teAjLR2dyLJT+ssiPMaJ1aZ2oytbUGw9WTBmKFRSrGPD/h yhJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=JOTPMrM9cXc3gHfHHUUOqsLEtBpDW5NPaRavY4aCrIo=; b=QySrufFd5of7WjOQUuVZIfNbKT0i9oJjC7zEsFWVVN1/k7X0pbHxB5kuiA3B7k6lFK ggsM0Cc4o9bu2habCECKcfQ5yAjntSmO90YFWkTNyHgdNrhL9H6BX694OwszU1SNYwgp 6v6LNhrkp2CwgZlUIZcERWswIUsDTgl/ncma0wcUqsZXkiUGiykq+iZ6iRCVavsy6WIe E+HkCfYB2r1IFwtsloS9XrbEUN10E9JLRx1IheHDOPWNSsvWenp+u8yaAZMTiAyQ/Adk 1rPhk9egUsjpGF9GC8OSN8lawKesgeYDyge7BvoyqKZTSwc53m+csD3J/Bz1EDR2NcNH N5hw== X-Gm-Message-State: AOAM532iBsv4DpSlj4la/m/r/Y1C/NiLdvXVCDz3d9h6KdRYbpbl3xAT l9tBsxlBhfT7fPv/9CbGYBM5XQ== X-Received: by 2002:adf:a549:: with SMTP id j9mr16145230wrb.199.1605110906715; Wed, 11 Nov 2020 08:08:26 -0800 (PST) Received: from elver.google.com ([2a00:79e0:15:13:f693:9fff:fef4:2449]) by smtp.gmail.com with ESMTPSA id y10sm3052674wru.94.2020.11.11.08.08.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2020 08:08:25 -0800 (PST) Date: Wed, 11 Nov 2020 17:08:20 +0100 From: Marco Elver To: Andrey Konovalov Cc: Dmitry Vyukov , Alexander Potapenko , Catalin Marinas , Will Deacon , Vincenzo Frascino , Evgenii Stepanov , Andrey Ryabinin , Branislav Rankov , Kevin Brodsky , Andrew Morton , kasan-dev@googlegroups.com, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 01/20] kasan: simplify quarantine_put call site Message-ID: <20201111160819.GC517454@elver.google.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.14.6 (2020-07-11) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 10, 2020 at 11:20PM +0100, Andrey Konovalov wrote: > Move get_free_info() call into quarantine_put() to simplify the call site. > > No functional changes. > > Signed-off-by: Andrey Konovalov > Reviewed-by: Dmitry Vyukov > Link: https://linux-review.googlesource.com/id/Iab0f04e7ebf8d83247024b7190c67c3c34c7940f > --- > mm/kasan/common.c | 2 +- > mm/kasan/kasan.h | 5 ++--- > mm/kasan/quarantine.c | 3 ++- > 3 files changed, 5 insertions(+), 5 deletions(-) Reviewed-by: Marco Elver > diff --git a/mm/kasan/common.c b/mm/kasan/common.c > index 2bb0ef6da6bd..5712c66c11c1 100644 > --- a/mm/kasan/common.c > +++ b/mm/kasan/common.c > @@ -308,7 +308,7 @@ static bool __kasan_slab_free(struct kmem_cache *cache, void *object, > > kasan_set_free_info(cache, object, tag); > > - quarantine_put(get_free_info(cache, object), cache); > + quarantine_put(cache, object); > > return IS_ENABLED(CONFIG_KASAN_GENERIC); > } > diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h > index 21fe75c66f26..c2c40ec1544d 100644 > --- a/mm/kasan/kasan.h > +++ b/mm/kasan/kasan.h > @@ -214,12 +214,11 @@ struct kasan_track *kasan_get_free_track(struct kmem_cache *cache, > > #if defined(CONFIG_KASAN_GENERIC) && \ > (defined(CONFIG_SLAB) || defined(CONFIG_SLUB)) > -void quarantine_put(struct kasan_free_meta *info, struct kmem_cache *cache); > +void quarantine_put(struct kmem_cache *cache, void *object); > void quarantine_reduce(void); > void quarantine_remove_cache(struct kmem_cache *cache); > #else > -static inline void quarantine_put(struct kasan_free_meta *info, > - struct kmem_cache *cache) { } > +static inline void quarantine_put(struct kmem_cache *cache, void *object) { } > static inline void quarantine_reduce(void) { } > static inline void quarantine_remove_cache(struct kmem_cache *cache) { } > #endif > diff --git a/mm/kasan/quarantine.c b/mm/kasan/quarantine.c > index 580ff5610fc1..a0792f0d6d0f 100644 > --- a/mm/kasan/quarantine.c > +++ b/mm/kasan/quarantine.c > @@ -161,11 +161,12 @@ static void qlist_free_all(struct qlist_head *q, struct kmem_cache *cache) > qlist_init(q); > } > > -void quarantine_put(struct kasan_free_meta *info, struct kmem_cache *cache) > +void quarantine_put(struct kmem_cache *cache, void *object) > { > unsigned long flags; > struct qlist_head *q; > struct qlist_head temp = QLIST_INIT; > + struct kasan_free_meta *info = get_free_info(cache, object); > > /* > * Note: irq must be disabled until after we move the batch to the > -- > 2.29.2.222.g5d2a92d10f8-goog >