Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4942527imm; Tue, 9 Oct 2018 07:28:29 -0700 (PDT) X-Google-Smtp-Source: ACcGV61DxeqmBw4s2yWCP05QTu1MczO5zTE2EpAUalg+iTzHHbCp+th7szh3mfEvnwZ25mS1vIU6 X-Received: by 2002:a17:902:7615:: with SMTP id k21-v6mr28721081pll.313.1539095309362; Tue, 09 Oct 2018 07:28:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539095309; cv=none; d=google.com; s=arc-20160816; b=wsjEBiZfZ6WaYEdwoOOWiTmXyCT6zY2oM3xKTWf7ahMlXZwy1kgNSausaUVglbvUCk z2St+jiIeb5Thk7mBXdeAUg7uoZGdYxJ3PLMnSmJHpBC9/K+aLWZejta0GSyNzfkL39e jUtrOd6gZtz5eoUbOudbFUGQVp+4MGcmGHniDL+mkrP3HtLrb83CG0q4T7SyekeiWz84 wURAPgKFikHuiSmgAbdskXnL1V2dIWKD003pcaV+4pgsnBy+J1b/l8CdKHJjHw6Ohp5B 5S1VTeHXkmkeGXHwEkbrP1EeZ2p3u9fc6ltdjq4Bw1gu2+Wye4svFB0lUdYmAic754zy coeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=sWXwPW1dW4J0Z4X18aY9ylMaBNNOCZprHbjKyQOxSvs=; b=ks+z99Lrt3jMrBgZhk1j/gB5eXzDlafQHeqcc+8DRWwDWUQeJ7CEcg7rgI3wrKGN6z YMozUF3KU/Y/ZLsKxJOJOUVeoC0ouqAAvnOaqGjDorDE87TjQlDPXncjsr7xq4KV4btU amgJaWFbhuZ9/caaZ4LwPUEkb94fVJeFr12w2SK+aThsafjBxK6+oxIwohtzbZHBWbVJ lLc7G30B83ksA4bEdlDKPWbmGiz5ix4mEI6EifIxfPCSPy8VmfrScVagAXNHEyKG5wfF QK3QF6qyd4lhX/Fl02UPvtdpfpQu4Hu9fb8mieuQwPSsDGGsS6sZ61T6h4JXg3aXY4J2 oxVg== 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 f33-v6si22825707plf.92.2018.10.09.07.28.13; Tue, 09 Oct 2018 07:28:29 -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 S1726568AbeJIVo7 convert rfc822-to-8bit (ORCPT + 99 others); Tue, 9 Oct 2018 17:44:59 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:43621 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726393AbeJIVo7 (ORCPT ); Tue, 9 Oct 2018 17:44:59 -0400 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1g9sz8-0005ij-Vn; Tue, 09 Oct 2018 16:27:43 +0200 Date: Tue, 9 Oct 2018 16:27:42 +0200 From: Sebastian Andrzej Siewior To: Dmitry Vyukov Cc: Clark Williams , Alexander Potapenko , kasan-dev , Linux-MM , LKML , linux-rt-users@vger.kernel.org, Peter Zijlstra , Thomas Gleixner Subject: Re: [PATCH] kasan: convert kasan/quarantine_lock to raw_spinlock Message-ID: <20181009142742.ikh7xv2dn5skjjbe@linutronix.de> References: <20180918152931.17322-1-williams@redhat.com> <20181005163018.icbknlzymwjhdehi@linutronix.de> <20181005163320.zkacovxvlih6blpp@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-10-08 11:15:57 [+0200], Dmitry Vyukov wrote: > Hi Sebastian, Hi Dmitry, > This seems to beak quarantine_remove_cache( ) in the sense that some > object from the cache may still be in quarantine when > quarantine_remove_cache() returns. When quarantine_remove_cache() > returns all objects from the cache must be purged from quarantine. > That srcu and irq trickery is there for a reason. That loop should behave like your on_each_cpu() except it does not involve the remote CPU. > This code is also on hot path of kmallock/kfree, an additional > lock/unlock per operation is expensive. Adding 2 locked RMW per > kmalloc is not something that should be done only out of refactoring > reasons. But this is debug code anyway, right? And it is highly complex imho. Well, maybe only for me after I looked at it for the first timeā€¦ > The original message from Clark mentions that the problem can be fixed > by just changing type of spinlock. This looks like a better and > simpler way to resolve the problem to me. I usually prefer to avoid adding raw_locks everywhere if it can be avoided. However given that this is debug code and a few additional us shouldn't matter here, I have no problem with Clark's initial patch (also the mem-free in irq-off region works in this scenario). Can you take it as-is or should I repost it with an acked-by? Sebastian