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=-5.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 96F5AC33C9E for ; Thu, 30 Jan 2020 11:33:57 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5CC50206D3 for ; Thu, 30 Jan 2020 11:33:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="LnxJ2hMK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5CC50206D3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-kernel-mentees-bounces@lists.linuxfoundation.org Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id BBD7E883A8; Thu, 30 Jan 2020 11:33:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DBJvq+K8kcf9; Thu, 30 Jan 2020 11:33:56 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 2A0AD88360; Thu, 30 Jan 2020 11:33:56 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0DC5EC0178; Thu, 30 Jan 2020 11:33:56 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 46AB1C0171 for ; Thu, 30 Jan 2020 11:33:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 32BE08770C for ; Thu, 30 Jan 2020 11:33:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L9ESHRA6YYBs for ; Thu, 30 Jan 2020 11:33:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by whitealder.osuosl.org (Postfix) with ESMTPS id A806A875C0 for ; Thu, 30 Jan 2020 11:33:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580384031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LckSruGS9mnZBhfnh1yRL8G9a5TasGSKYWZgAtg7IgQ=; b=LnxJ2hMKK37F6m/OVEnYpZ2yJ9b7idtobo2MAnraRIV2mGol/JxvHrVRyTL/R2gGtOyVsf xRI9s5LXw7hMznXfmv7WkdB10M45YBJtMK1yN4/IYdUNu+Ic0uEhGGWEdQiRD5udUHMb2w 9u2baHnyv5jfiG19xF1JK6GQne7P0go= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-284-WnfvjFYcPFqnPoKMKI5ZAQ-1; Thu, 30 Jan 2020 06:33:46 -0500 X-MC-Unique: WnfvjFYcPFqnPoKMKI5ZAQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1D4EF190B2D7; Thu, 30 Jan 2020 11:33:44 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.70]) by smtp.corp.redhat.com (Postfix) with SMTP id 431E487B01; Thu, 30 Jan 2020 11:33:42 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Thu, 30 Jan 2020 12:33:43 +0100 (CET) Date: Thu, 30 Jan 2020 12:33:41 +0100 From: Oleg Nesterov To: Christian Brauner Message-ID: <20200130113339.GA25426@redhat.com> References: <20200130062028.4870-1-madhuparnabhowmik10@gmail.com> <20200130103158.azxldyfnugwvv6vy@wittgenstein> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200130103158.azxldyfnugwvv6vy@wittgenstein> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Cc: paulmck@kernel.org, peterz@infradead.org, linux-kernel@vger.kernel.org, rcu@vger.kernel.org, madhuparnabhowmik10@gmail.com, joel@joelfernandes.org, linux-kernel-mentees@lists.linuxfoundation.org, mingo@kernel.org Subject: Re: [Linux-kernel-mentees] [PATCH] exit.c: Fix Sparse errors and warnings X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" On 01/30, Christian Brauner wrote: > > On Thu, Jan 30, 2020 at 11:50:28AM +0530, madhuparnabhowmik10@gmail.com wrote: > > From: Madhuparna Bhowmik > > > > This patch fixes the following sparse error: > > kernel/exit.c:627:25: error: incompatible types in comparison expression > > > > And the following warning: > > kernel/exit.c:626:40: warning: incorrect type in assignment > > > > Signed-off-by: Madhuparna Bhowmik > > I think the previous version was already fine but hopefully > RCU_INIT_POINTER() really saves some overhead. In any case: It is not about overhead, RCU_INIT_POINTER() documents the fact that we didn't make any changes to the new parent, we only need to change the pointer. And btw, I don't really understand the __rcu annotations. Say, according to sparse this code is wrong: int __rcu *P; void func(int *p) { P = p; } OK, although quite possibly it is fine. However, this code int __rcu *P; void func(int __rcu *p) { *p = 10; P = p; } is almost certainly wrong but sparse is happy, asn is the same. > Acked-by: Christian Brauner Acked-by: Oleg Nesterov _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees