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=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham 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 5D516C46464 for ; Tue, 14 Aug 2018 00:04:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 11E9C2174C for ; Tue, 14 Aug 2018 00:04:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 11E9C2174C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730860AbeHNCsh (ORCPT ); Mon, 13 Aug 2018 22:48:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:45128 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729230AbeHNCsh (ORCPT ); Mon, 13 Aug 2018 22:48:37 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (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 71F072174B; Tue, 14 Aug 2018 00:04:01 +0000 (UTC) Date: Mon, 13 Aug 2018 20:03:59 -0400 From: Steven Rostedt To: Oleg Nesterov Cc: Ravi Bangoria , Song Liu , srikar@linux.vnet.ibm.com, mhiramat@kernel.org, Peter Zijlstra , mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, open list , ananth@linux.vnet.ibm.com, Alexis Berlemont , naveen.n.rao@linux.vnet.ibm.com, linux-arm-kernel@lists.infradead.org, linux-mips@linux-mips.org, linux@armlinux.org.uk, ralf@linux-mips.org, paul.burton@mips.com Subject: Re: [PATCH v8 3/6] Uprobes: Support SDT markers having reference count (semaphore) Message-ID: <20180813200359.31311bbb@gandalf.local.home> In-Reply-To: <20180813115019.GB28360@redhat.com> References: <20180809041856.1547-1-ravi.bangoria@linux.ibm.com> <20180809041856.1547-4-ravi.bangoria@linux.ibm.com> <95a1221e-aecc-42be-5239-a2c2429be176@linux.ibm.com> <20180813115019.GB28360@redhat.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; 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 Mon, 13 Aug 2018 13:50:19 +0200 Oleg Nesterov wrote: > On 08/13, Ravi Bangoria wrote: > > > > On 08/11/2018 01:27 PM, Song Liu wrote: > > >> + > > >> +static void delayed_uprobe_delete(struct delayed_uprobe *du) > > >> +{ > > >> + if (!du) > > >> + return; > > > Do we really need this check? > > > > Not necessary though, but I would still like to keep it for a safety. > > Heh. I tried to ignore all minor problems in this version, but now that Song > mentioned this unnecessary check... > > Personally I really dislike the checks like this one. > > - It can confuse the reader who will try to understand the purpose > > - it can hide a bug if delayed_uprobe_delete(du) is actually called > with du == NULL. > > IMO, you should either remove it and let the kernel crash (to notice the > problem), or turn it into > > if (WARN_ON(!du)) > return; I'd prefer the more robust WARN_ON(!du) above instead of removing it. -- Steve