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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 EC5F6C7618B for ; Mon, 29 Jul 2019 18:29:10 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (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 AE10B2073F for ; Mon, 29 Jul 2019 18:29:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE10B2073F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=vt.edu Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=kernelnewbies-bounces+kernelnewbies=archiver.kernel.org@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92) (envelope-from ) id 1hsAOT-0002Zd-HR for kernelnewbies@archiver.kernel.org; Mon, 29 Jul 2019 14:29:09 -0400 Received: from omr2.cc.ipv6.vt.edu ([2607:b400:92:8400:0:33:fb76:806e] helo=omr2.cc.vt.edu) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hsAMb-0000Qi-4k for kernelnewbies@kernelnewbies.org; Mon, 29 Jul 2019 14:27:13 -0400 Received: from mr3.cc.vt.edu (mr3.cc.ipv6.vt.edu [IPv6:2607:b400:92:8500:0:7f:b804:6b0a]) by omr2.cc.vt.edu (8.14.4/8.14.4) with ESMTP id x6TIRB8o023224 for ; Mon, 29 Jul 2019 14:27:11 -0400 Received: from mail-vs1-f72.google.com (mail-vs1-f72.google.com [209.85.217.72]) by mr3.cc.vt.edu (8.14.7/8.14.7) with ESMTP id x6TIR5LJ011657 for ; Mon, 29 Jul 2019 14:27:10 -0400 Received: by mail-vs1-f72.google.com with SMTP id k1so16149010vsq.8 for ; Mon, 29 Jul 2019 11:27:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :mime-version:content-transfer-encoding:date:message-id; bh=+lSqAskBrv88NkoefMJzt8W/LEIiMH7RIVv6rYVhp3s=; b=ZcZKJr1J/wtYMmqd9qCO3UwYXy1t1J04mwzQTvoTcS/e2kEMsCJZ8Ws2F26kaCkN3s O7g71PfEMZOVluO8CqdQOa9QBy8JZM+6gYPZZNzNpjvdWAOEynM/1Khx49eLTxQe2OWK rv54c7uGN+fUBPU3uiHV6Kyr5FzNKj5u56vnxeNjh+EvJ6Q1PEiw6kpI4V9H2JlOluJv k1iuL8sNgEiB8Cn89XTGLP5vl1JSJi8WYKjQAUMeCqV81V935IQ/9T2KKO36s8A7JirZ Xl/oEFScgqyWI1pR+arHkHhk6xmcENN7OCD2gJxgmjv1ilJGAdBau1A//SZavs2yunRz xh9g== X-Gm-Message-State: APjAAAWIHc+EJBEky+2VTKLDnC9QgPWTOk5FETo5bGFRShVuqQLszD0A DVI3izKmjn+9E0zw2tK1tg2k437PIHLq8fWlHnGi+YrpqgXNh8h4qj1B9BPGxfDTTd5KWu8N4oK JDODOIcncmZsvbRGL+h38B9QlXF/pgc7HetAkL5A= X-Received: by 2002:a67:f759:: with SMTP id w25mr68963385vso.235.1564424825699; Mon, 29 Jul 2019 11:27:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVxN6o5VWn4x7c7NQjdT6euVR/VitVS+O8n6uPFLgNfiOSsBmXLYNlEnnt9/7lzMyHTkmyZw== X-Received: by 2002:a67:f759:: with SMTP id w25mr68963304vso.235.1564424825089; Mon, 29 Jul 2019 11:27:05 -0700 (PDT) Received: from turing-police ([2601:5c0:c001:4341::7ca]) by smtp.gmail.com with ESMTPSA id p190sm13531738vsd.15.2019.07.29.11.27.03 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 29 Jul 2019 11:27:03 -0700 (PDT) From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Google-Original-From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev To: Muni Sekhar Subject: Re: wait_event()\ wait_event_interruptible()\ wait_event_interruptible_timeout() and wake_up() In-Reply-To: References: Mime-Version: 1.0 Date: Mon, 29 Jul 2019 14:27:02 -0400 Message-ID: <22208.1564424822@turing-police> Cc: kernelnewbies X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============4771691765709766034==" Errors-To: kernelnewbies-bounces+kernelnewbies=archiver.kernel.org@kernelnewbies.org --===============4771691765709766034== Content-Type: multipart/signed; boundary="==_Exmh_1564424822_8191P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --==_Exmh_1564424822_8191P Content-Type: text/plain; charset=us-ascii On Mon, 29 Jul 2019 22:48:57 +0530, Muni Sekhar said: > Let us assume that multiple processes are waiting on wait_event()\ > wait_event_interruptible()\ wait_event_interruptible_timeout(), which > process gets woken up on calling wake_up()?? > > I presume wake_up() picks one process, but is there any algorithm to > pick which process? Hint: If you have more than one process waiting, and they do the same thing (think multiple copies of the same kthread), it probably doesn't matter. If they do different things and which one gets picked matters for correctness, you're doing it wrong and probably need some locking. If they do different things and the results will be correct no matter which order they're picked, but you want one to go first for latency/througput considerations, you have a scheduling/priority issue and probably need to fix it using the vast plethora of knobs and tools available for that purpose. --==_Exmh_1564424822_8191P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Comment: Exmh version 2.9.0 11/07/2018 iQIVAwUBXT86dgdmEQWDXROgAQLM7Q/+JoIvK2gCCnUnnsrrbW/tIV7nPH9bN6Sj te/1XvzmP+gc2cAH3XRUe6zjVfTwpGEJBbrvnhN6ktJBuG8pHqqhkVhj5zzQ4WZv QZgJWa7vO9wzPDRZXJdJR6oSqWLG28ywWn4MrcKANSTsjWStzECdatjaSgtfXM9K t2t2TbqOWMo1mzbHLOrldF8VQWYmQJEkc7V88/sXIueA0G8kQ9UHPcYrwtcDsAXe TVXeJu68JId7FQVFLGzUZQ6llMS1C5Yj++2UfRYIb8Zy9l7+Wd60uN0THA1ZqFI7 gnduO4Gp07Nzyy7G3SpP21liQrzrkpGsfpnQDMCd+nAyR8eOQQn5JzMFEACLsquV emAB3AGkHJw7bxpLRAjXauKjNO7HAOxQXPu4NsKSGm8aHaaA2MLjH3Rnns3sVGHw Ct15bLPNjOqOpV2HR7ViNYulLtHMTzGdPRgy9x/cyhsrVlopkj8PMJ+pC7sHyHkQ 36JaJHVPQ3CD8rvwk9b+acdNckesSjLHVWy6FtgFtJH78qVuwtm78vD1LqOuVCA9 dik1UkZ8KWcK06391eQTwwGEhNE9SPbPJROH1nMsmmBCvENqFsDnWC3Rm4+vQGLO 292U49zaHeqUz6wKwCTe9xB2HX4iJfdmoKLUa0E7Q8zo+n7Xqp7Tv3dye4Sn+wBn +swm+wJNDxg= =8KoS -----END PGP SIGNATURE----- --==_Exmh_1564424822_8191P-- --===============4771691765709766034== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============4771691765709766034==--