Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2313335yba; Fri, 17 May 2019 14:43:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlbYvjJ/O7oEFcGH+wWdTgvWlBFPDv1/C+vAaaLwmgj0E0E6n+73EhUYepxzUZFI6dxjhS X-Received: by 2002:a62:6341:: with SMTP id x62mr62501239pfb.63.1558129397965; Fri, 17 May 2019 14:43:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558129397; cv=none; d=google.com; s=arc-20160816; b=xkEkHlb5IMRJ38fhHQjaxMVd33hfUQh0wg+/eEBjue9/4LbSnkXZY+Hf5U0X8K3z/T fR2bVtYc7cjmhyUDy/l9eWCW76sZ2iPEKzStMM5+nkromeL2F5N5DmRjQQVgSHVl/8aC LKXJU1uR1zrjbLbYO5mvQDLY9rqqeWw0F1CszhxG5WDLC99d4aSAtOCQqWcCADhsoJfa /5bbny43fcqpUjffICsDQRF6NLQ9lKGjP+3WEwOu5d9b6WhMhDGQL7XAzn2zvBhjyuJT 7TYeTrfppRE6M03DnI9zYCOp2pPxIF3FPCx/SJqShxFz/fs/ZboobnyB3wXezN01+zoJ Co7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=8gEh3e4sCXemcPk2Uur0pjeXhCScach2WX84NIsTDx8=; b=BjYvzVUPR22TQ3Y1BOX9JYF9YMWivmp8UuWm4iSoIHdiV98Y9jbZe8RyN5hTu7FeTc DFWJyoo2w1VFOz6zJFUla29AnCs088sD9of5yGg5yTsxI6a5pY+AA5wZe9t/9koj9cPK S2czvYLgcOYZJFayXgsT+UUmBCA1JoQ4aI5otznB/rY0mRoN5kEgLss0jVNwY54PVMYn sDa+3qieCmwFSZbs7kmVlJss4vWlNfsvini8bC+g/0VFfQFt+Vq7+5linKOGcaln8trC 3JGc6q4wVXCwRmqlMDi8NHW382dAfCio2SV/CAxFAtkZfoH8QaS1NS8XaIoOhmM7Bjk2 q2eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="zyaA/h6a"; 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 o61si6112946pld.82.2019.05.17.14.43.03; Fri, 17 May 2019 14:43:17 -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; dkim=pass header.i=@kernel.org header.s=default header.b="zyaA/h6a"; 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 S1729510AbfEQVhr (ORCPT + 99 others); Fri, 17 May 2019 17:37:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:44084 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726960AbfEQVhr (ORCPT ); Fri, 17 May 2019 17:37:47 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E79DB20815; Fri, 17 May 2019 21:37:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558129067; bh=aV+DZYgCxz6TeUuopFM95pRHxHKcPxgDyN99N5XYJko=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=zyaA/h6aSWnQbfVIYgqsy2UrDKSlqT0fUgWvQgq/rIbENLvBDNuAhY84I4Cm0CmLD cPGqFAtx/nnBYevpcWHQItaMk+wpufHLo0tSppdBJA4ooerLdUqPl1v/gMovZc1ya9 Y/ZZQIjHjuO4Er8F1QTdG0soYL1cGA93941vJyYY= Date: Fri, 17 May 2019 14:37:46 -0700 From: Andrew Morton To: Dmitry Vyukov Cc: catalin.marinas@arm.com, Dmitry Vyukov , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kmemleak: fix check for softirq context Message-Id: <20190517143746.2157a759f65b4cbc73321124@linux-foundation.org> In-Reply-To: <20190517171507.96046-1-dvyukov@gmail.com> References: <20190517171507.96046-1-dvyukov@gmail.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 17 May 2019 19:15:07 +0200 Dmitry Vyukov wrote: > From: Dmitry Vyukov > > in_softirq() is a wrong predicate to check if we are in a softirq context. > It also returns true if we have BH disabled, so objects are falsely > stamped with "softirq" comm. The correct predicate is in_serving_softirq(). > > ... > > --- a/mm/kmemleak.c > +++ b/mm/kmemleak.c > @@ -588,7 +588,7 @@ static struct kmemleak_object *create_object(unsigned long ptr, size_t size, > if (in_irq()) { > object->pid = 0; > strncpy(object->comm, "hardirq", sizeof(object->comm)); > - } else if (in_softirq()) { > + } else if (in_serving_softirq()) { > object->pid = 0; > strncpy(object->comm, "softirq", sizeof(object->comm)); > } else { What are the user-visible runtime effects of this change?