Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp3325620ybk; Tue, 19 May 2020 01:38:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxNNz06SQROBgejl1Md7CvKcxWz2GU44feUa70h6iP/jWF9qWoJW+yfsu2O05ROiYBlAkT X-Received: by 2002:a17:906:2799:: with SMTP id j25mr17037024ejc.369.1589877502028; Tue, 19 May 2020 01:38:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589877502; cv=none; d=google.com; s=arc-20160816; b=rVNpBlGsFHR70gPAGBJzWaexYrFFB7n6Oh11ka3UiMn4WL8wIxeqsqj19ABU+EWzFu 9zua0Aqr6W7lQ6lfPWkiJDqxM6YhqikvIL6JH4JcpIaQH70C1nkXEYOUEgixqoWCriNa Jg310KCNyvcn/eUnJlwW6VeWkjuVtPDKabc19/C5EheFsfgwjVZRMuFQ2xpxO9UH4BfW xh+TNQaXxrkpEMNZFgMgvqL/WpAZ7wU+KGpE3wK5O29q+5knABa0UKjt2QvzAQKnmsIy 0DFqjgVF3OZW047tGFyxDZftfCl2r440TZ50E0Zd4Satm+d2CF7PoW08fqFLUP7dv0pT 0XKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=neCYSjEi88TNGn0YB1aKi0UeMLdzd6tvpIhiKm1L4UE=; b=KN9dnQ2yuaIefyUv6OMDls8xVSsNkylM0rhlmv8N+Ho3EK/Da1gF2CXmGMruesNhJJ gPZeE99OP5N2meGG1lTsR53ibG1xFDDND19pFF4nWaYQR1qytEHKx77W/INAKDNK1oiT JsC0L6IEyg0o0qJiRf0HSOuR10iA0y3R+bCljV19xn3+/p2nNDvbF62UhdJ2ACo+IC4U NWgwz4k8ap2inNxfmJP0TtoxaY7Yp7tACnkn/2xffGbeSJQ449sUoJGu3fxOaaQogd8p S1Ab7kKDOtcpt4USUeVXoBxgaXIGppxfsxq5YofEktT0ekoWgv/YrOvaVfgeEHsdqOI5 cxgQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx19si6183536edb.89.2020.05.19.01.37.57; Tue, 19 May 2020 01:38:22 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726818AbgESIgY (ORCPT + 99 others); Tue, 19 May 2020 04:36:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbgESIgX (ORCPT ); Tue, 19 May 2020 04:36:23 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D1CCC061A0C for ; Tue, 19 May 2020 01:36:23 -0700 (PDT) Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jaxjV-000476-KX; Tue, 19 May 2020 10:36:17 +0200 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 2386B1006A1; Tue, 19 May 2020 10:36:11 +0200 (CEST) From: Thomas Gleixner To: Xianting Tian , john.stultz@linaro.org, sboyd@kernel.org Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] timers: Use set_current_state macro In-Reply-To: <1589469647-33814-1-git-send-email-xianting_tian@126.com> References: <1589469647-33814-1-git-send-email-xianting_tian@126.com> Date: Tue, 19 May 2020 10:36:11 +0200 Message-ID: <87imgsuxs4.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Xianting Tian writes: > Use set_current_state macro instead of current->state = TASK_RUNNING > > Signed-off-by: Xianting Tian > --- > kernel/time/timer.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/time/timer.c b/kernel/time/timer.c > index 4820823..b9ecf87 100644 > --- a/kernel/time/timer.c > +++ b/kernel/time/timer.c > @@ -1882,7 +1882,7 @@ signed long __sched schedule_timeout(signed long timeout) > printk(KERN_ERR "schedule_timeout: wrong timeout " > "value %lx\n", timeout); > dump_stack(); > - current->state = TASK_RUNNING; > + set_current_state(TASK_RUNNING); This is still wrong. Again: "That's not the same and adds a barrier which is not needed. Not a big problem in that particular error handling code path, but in general you really have to look whether your replacement is resulting in the same code. If not then you need to make an argument in the changelog why you are replacing existing code with something which is not fully equivalent. For this particular case, please check the implementation and read the documentation of set_current_state() in include/linux/sched.h." Thanks, tglx