Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp5632163pxb; Mon, 28 Mar 2022 15:14:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzweug4E7ArBZtKYM2xloqaFMEJZXMqd1iTxJLvOv6nIOvySV0tkt0nCZwfO486Jgpjajww X-Received: by 2002:a05:6870:a985:b0:dd:fb7f:8e3f with SMTP id ep5-20020a056870a98500b000ddfb7f8e3fmr662261oab.267.1648505665887; Mon, 28 Mar 2022 15:14:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648505665; cv=none; d=google.com; s=arc-20160816; b=YhVWB2Hu/gGJ4b8jgYSiXzoyRc9lUC+O8awSBBlrpb2sMDjcCr2wFZuMV+m90pQt3I NhjZe5Ya8atYqNrAFZoaJE+Kqnkz+s/+aWM9Q0Lox8TsYvUvhhOGYQMgGnOoa94iho5L wwlBrrzjc/+NrU0XzdPZNf69jqm6vEzmDet7+27o8X69Eh/myJZWKdVNwD/QQkqYI2cu 3CIix0llL33CtsHMGbnSdOSN+MLdu760M8tEwNtNs5GT2ID456gjCSeE/GgFRl4YiAJ2 mSS9YpDTCvmZb/7wdpwRROK3LqCtR+4LLCfK0Y0/aAX0akYp2MXlhdJddOra1JjtOzHy quoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=iiTWiXg3repmNdg1Lg6AudefAR3R2YTlD7u2pBnhmOA=; b=iDn9Vocg7kukid09XPI8kniWtrT20mnnDYkLKX1CPtNx5CUCiCADprxBxIT6XeV0mu x7sxzL+akKLLK9dAkxqGqTRWnbq+o3imSr4wsfLHq3wIrNd3/MQkP26SBUc6kpxZcztv zA8BgLpuvBl6DmR+iado7NylxExt33vpKHy3UudeTrwk8wFspWoS8Hai9iP1iH3clJdI w9XqEsi5TW23ooz++sARcIVSrjQAncfikob8JEsUJAhi5a/kJL+sht2E2RtZz40zokzo XC1qB9Q5pyxUHlv+wRW5VNmcA8PCcrEYPxKficMXU61JpxnuDf76EYL1KfwLkD9o+fWw crKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=w3cAsglS; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u6-20020a056808150600b002ef87419ef7si11976466oiw.221.2022.03.28.15.14.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 15:14:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=w3cAsglS; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 34AE5171EDC; Mon, 28 Mar 2022 14:33:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240119AbiC1KAy (ORCPT + 99 others); Mon, 28 Mar 2022 06:00:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240113AbiC1KAw (ORCPT ); Mon, 28 Mar 2022 06:00:52 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6118142490; Mon, 28 Mar 2022 02:59:12 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 1E2C5210EA; Mon, 28 Mar 2022 09:59:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1648461551; h=from:from:reply-to: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=iiTWiXg3repmNdg1Lg6AudefAR3R2YTlD7u2pBnhmOA=; b=w3cAsglSQAeuB3h4e410ghJ6wveRSYL5MoAGtutSdr5DyPqRIma30N9GW3aRZviT5xIJsv qOAznb33JI4wPbrwf6cxuZTwQpzte4dLJ76iCfhkaSJR1+NjACvVuXiUDYsKagOCmuR4Cl gZAco2jNRzlPTd3Qw6+Qf55HdIIf8x4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1648461551; h=from:from:reply-to: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=iiTWiXg3repmNdg1Lg6AudefAR3R2YTlD7u2pBnhmOA=; b=7adj626p536xHfFhrfQaKE1zb3vuXgCKxRB71Gjs+N+KVl840ivPB6N+1XgnyWzDFgdt4i TdAi7TPxP2R33iCw== Received: from quack3.suse.cz (unknown [10.163.43.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 0FA13A3B82; Mon, 28 Mar 2022 09:59:11 +0000 (UTC) Received: by quack3.suse.cz (Postfix, from userid 1000) id BB4BDA0610; Mon, 28 Mar 2022 11:59:10 +0200 (CEST) Date: Mon, 28 Mar 2022 11:59:10 +0200 From: Jan Kara To: Jiri Slaby Cc: axboe@kernel.dk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph Hellwig , Jan Kara Subject: Re: [PATCH] block: restore the old set_task_ioprio() behaviour wrt PF_EXITING Message-ID: <20220328095910.fyifhw6ry4ggcdbc@quack3.lan> References: <20220328085928.7899-1-jslaby@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220328085928.7899-1-jslaby@suse.cz> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 28-03-22 10:59:28, Jiri Slaby wrote: > PF_EXITING tasks were silently ignored before the below commits. > Continue doing so. Otherwise python-psutil tests fail: > ERROR: psutil.tests.test_process.TestProcess.test_zombie_process > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "/home/abuild/rpmbuild/BUILD/psutil-5.9.0/build/lib.linux-x86_64-3.9/psutil/_pslinux.py", line 1661, in wrapper > return fun(self, *args, **kwargs) > File "/home/abuild/rpmbuild/BUILD/psutil-5.9.0/build/lib.linux-x86_64-3.9/psutil/_pslinux.py", line 2133, in ionice_set > return cext.proc_ioprio_set(self.pid, ioclass, value) > ProcessLookupError: [Errno 3] No such process > > During handling of the above exception, another exception occurred: > > Traceback (most recent call last): > File "/home/abuild/rpmbuild/BUILD/psutil-5.9.0/psutil/tests/test_process.py", line 1313, in test_zombie_process > succeed_or_zombie_p_exc(fun) > File "/home/abuild/rpmbuild/BUILD/psutil-5.9.0/psutil/tests/test_process.py", line 1288, in succeed_or_zombie_p_exc > return fun() > File "/home/abuild/rpmbuild/BUILD/psutil-5.9.0/build/lib.linux-x86_64-3.9/psutil/__init__.py", line 792, in ionice > return self._proc.ionice_set(ioclass, value) > File "/home/abuild/rpmbuild/BUILD/psutil-5.9.0/build/lib.linux-x86_64-3.9/psutil/_pslinux.py", line 1665, in wrapper > raise NoSuchProcess(self.pid, self._name) > psutil.NoSuchProcess: process no longer exists (pid=2057) > > Cc: Christoph Hellwig > Cc: Jan Kara > Cc: Jens Axboe > Fixes: 5fc11eebb4 (block: open code create_task_io_context in set_task_ioprio) > Fixes: a957b61254 (block: fix error in handling dead task for ioprio setting) > Signed-off-by: Jiri Slaby OK, as much as I find it disputable what ioprio_set() should be doing for PF_EXITTING task, I guess there's no harm in maintaining the old behavior and just ignoring the call. So feel free to add: Reviewed-by: Jan Kara Honza > --- > block/blk-ioc.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/block/blk-ioc.c b/block/blk-ioc.c > index 11f49f78db32..df9cfe4ca532 100644 > --- a/block/blk-ioc.c > +++ b/block/blk-ioc.c > @@ -280,7 +280,6 @@ int set_task_ioprio(struct task_struct *task, int ioprio) > > task_lock(task); > if (task->flags & PF_EXITING) { > - err = -ESRCH; > kmem_cache_free(iocontext_cachep, ioc); > goto out; > } > @@ -292,7 +291,7 @@ int set_task_ioprio(struct task_struct *task, int ioprio) > task->io_context->ioprio = ioprio; > out: > task_unlock(task); > - return err; > + return 0; > } > EXPORT_SYMBOL_GPL(set_task_ioprio); > > -- > 2.35.1 > -- Jan Kara SUSE Labs, CR