Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4107142iog; Tue, 28 Jun 2022 09:07:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u+gRkUKOyHKeX64KfvaCOfjn8Cy4dAfE5Wb+Q2F40i1yKu/y8IY+u98XIUPludIDhc3fjK X-Received: by 2002:a62:388d:0:b0:525:138d:74ea with SMTP id f135-20020a62388d000000b00525138d74eamr4399609pfa.19.1656432441010; Tue, 28 Jun 2022 09:07:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656432441; cv=none; d=google.com; s=arc-20160816; b=tTpqnz1EWXOfcIR7MnH59jeRXP2vlvLrnjuJouoJCEDu2hcAeuWxBT7ohc1jq52YC7 a/TuTuHbFkYRW5yae4xxxmxvD8x53NPb8Rl92W2AaK4npQ19CegtJ0kzRk9ZOLsyU+eq c8MIse7nqD4z7UKs8d1Ir8tuc5Vqnkbp+YTWCoezlaDr5wTeqys3/DXcW6V49RzjHRel IMTDOeUDZgnL/7J9jpPYq4ydCzhs8on6JpPiVKjYoYbpokEL3RRJbrgV80xPwBM+6RRG HecGA4DjT3jyhED0r3hKd21RNtlBRv1pe640y0as1kgb4oxZNFStMoxgLPaxd9rqTPM3 LhZg== 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; bh=08Z8m+5SnpYMfrUky7ceZsy039gVfd2LXp8U4ZyDynU=; b=jr6AGbe9GUD5qdPX9u2Pbf5PgWMwJG8rN593UYSh4NlCKH8GCGfqZ9JU7Nk0IIGZBu O9bXE2RDj3dc3vwGx5KJ9cvcZG64tVQ2XvtPL2Ihxs1gWI3STUFpUhIm3j8aHKxtcYKR 7dM6evl6LtaoH0ZXIp+Y0roTSHRN0ynL3p8p/H1ZJhk9Offon1Al/72Q8bQAi18EbQ3I FjIIFlBYkvpyvdfEiJRk5cW+b5ylNO6NVF4+vRG+gtcUkfIyOMsvc5JGACETlaTyufk0 riToLLuNLWBFDMWyk56nrGb+ILJK7/Zw2jNrPgj0LBgwz0gJjtKFHgqbsSRY6Vu2hez4 Rw5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b="fn8GFMp/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i9-20020a170902c94900b0016a3e7fdb43si21448693pla.158.2022.06.28.09.07.08; Tue, 28 Jun 2022 09:07:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b="fn8GFMp/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348187AbiF1P73 (ORCPT + 99 others); Tue, 28 Jun 2022 11:59:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348190AbiF1P7S (ORCPT ); Tue, 28 Jun 2022 11:59:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E13FD17E2B for ; Tue, 28 Jun 2022 08:59:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6A45661763 for ; Tue, 28 Jun 2022 15:59:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 060E1C341C6; Tue, 28 Jun 2022 15:59:15 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="fn8GFMp/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1656431954; 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=08Z8m+5SnpYMfrUky7ceZsy039gVfd2LXp8U4ZyDynU=; b=fn8GFMp/Y9zjBaL1vxMwDywM01xTcdOH4PhLDRvy1Vt9lWeEqJIviIYQoySTzToE/cRX1A WoYDTojzGFmehYCuIEmIXDYaj372GGpk9chpabxewKx+jWP6XI9Kk4L9fhzMeM9qhA3+2i Q4/7cS/sNV6jt31rSGJpAuSld18YH3k= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 4d7d88c1 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Tue, 28 Jun 2022 15:59:14 +0000 (UTC) Date: Tue, 28 Jun 2022 17:59:11 +0200 From: "Jason A. Donenfeld" To: "Eric W. Biederman" Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= , Kalle Valo , Johannes Berg Subject: Re: [PATCH v2] signal: break out of wait loops on kthread_stop() Message-ID: References: <20220627145716.641185-1-Jason@zx2c4.com> <877d51udc7.fsf@email.froward.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <877d51udc7.fsf@email.froward.int.ebiederm.org> X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Hi Eric, On Mon, Jun 27, 2022 at 02:16:08PM -0500, Eric W. Biederman wrote: > Semantically this makes a lot of sense. > > Bloating up signal_pending which is mainly called in non-kthread > contexts is undesirable. I guess I understand that concern, but does it really matter here? This is called by code that waits anyway, so it's not like performance matters at all, right? > Instead could you modify kthread_stop to call set_notify_signal(). > > That is exactly what set_notify_signal is there for. When you don't > actually have a signal but you want to break out of an interruptible > loop. My last round of work in the area decoupled set_notify_signal > from any other semantics. This sounds like the best option here, if in fact it does work. I'll send in a patch for that and we can see how it interacts with the other work you're doing. Jason