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 A9EF2C7618B for ; Mon, 29 Jul 2019 18:29:41 +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 799A12073F for ; Mon, 29 Jul 2019 18:29:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 799A12073F 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.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92) (envelope-from ) id 1hsAOx-0002nr-A1; Mon, 29 Jul 2019 14:29:39 -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 1hsAOu-0002nl-Qm for kernelnewbies@kernelnewbies.org; Mon, 29 Jul 2019 14:29:36 -0400 Received: from mr6.cc.vt.edu (mr6.cc.vt.edu [IPv6:2607:b400:92:8500:0:af:2d00:4488]) by omr2.cc.vt.edu (8.14.4/8.14.4) with ESMTP id x6TITauN024055 for ; Mon, 29 Jul 2019 14:29:36 -0400 Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) by mr6.cc.vt.edu (8.14.7/8.14.7) with ESMTP id x6TITVxK007000 for ; Mon, 29 Jul 2019 14:29:36 -0400 Received: by mail-vk1-f198.google.com with SMTP id x71so18031129vkd.15 for ; Mon, 29 Jul 2019 11:29:36 -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=7PasXjRpt/ncYHXKAvegeJXWDFJpEcGQUoqyQqJ+t6k=; b=MuPpf+Lk0tAld0HPjP7UiWNaPaIlSJuedw/bdbCsRGVhbFSUKX0AH8Xu+ibXK7Lxqz y6po6lfu+z71iD6ZFUCVoY0Q61imsUA7A58o/aEbvcutTm9h6sssZXSkCAJdPl8SQgGZ sogEUXel10kL7+1MScFpT0Xrx59kfJoItrGrx8UlPRzt+qpY+pm03a9iawNU/1+vFYCC NA8PyegGz3ngCTAg+tMRi5LA6d8tCaUT9FLveKvrpdqklW3UkGYZDgoOXOm05R/+Sgn+ FAMlHHjWL0IQLAgs5KwRGwX1sipIsvft/3txbbHELPluysWOWsniiDOiWSusU6MXyOVQ o0fQ== X-Gm-Message-State: APjAAAWCI4IJLMur5FI9KH4TRqcUvmtnjZXAB++uY3VyIRUCMVdXt0uY 58rBdAMy/esIXk+S9Fq4DejfXlPf+iJ6T/UkWHApBL2PaXsMA1IcK8ol+X4u0TNRVmPKSiHPjb3 NbZ81EXDvuDeNvxNfxeVxUsd2LICUwmYKnQ8S+o4= X-Received: by 2002:a67:ea49:: with SMTP id r9mr49029945vso.223.1564424971090; Mon, 29 Jul 2019 11:29:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdOholIuVRszc2d2t9ssI6c2zUprJb0XGZoPKraiNxmEPQAxvtRpzd9yYu/aND4uYz42nvIg== X-Received: by 2002:a67:ea49:: with SMTP id r9mr49029914vso.223.1564424970863; Mon, 29 Jul 2019 11:29:30 -0700 (PDT) Received: from turing-police ([2601:5c0:c001:4341::7ca]) by smtp.gmail.com with ESMTPSA id q69sm38996417vkq.18.2019.07.29.11.29.29 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 29 Jul 2019 11:29:29 -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: <20190729180122.GA11403@bharath12345-Inspiron-5559> Mime-Version: 1.0 Date: Mon, 29 Jul 2019 14:29:28 -0400 Message-ID: <22273.1564424968@turing-police> Cc: Bharath Vedartham , 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="===============6278806291760488340==" Errors-To: kernelnewbies-bounces@kernelnewbies.org --===============6278806291760488340== Content-Type: multipart/signed; boundary="==_Exmh_1564424968_8191P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --==_Exmh_1564424968_8191P Content-Type: text/plain; charset=us-ascii On Mon, 29 Jul 2019 23:37:34 +0530, Muni Sekhar said: > On Mon, Jul 29, 2019 at 11:31 PM Bharath Vedartham wrote: > > Sorry to spoil the fun here. But check out what the queue data structure > > is all about. 'wait_queue' :) > A wait queue is a doubly linked list of wait_queue_t structures that > hold pointers to the process task structures of the processes that are > blocking. Each list is headed up by a wait_queue_head_t structure, > which marks the head of the list and holds the spinlock to the list to > prevent wait_queue_t additional race conditions So... if you're picking the first entry off a linked list, how do you ensure that the one you want run is the one that gets picked? Make sure the right one is at the head of the list, of course. ;) --==_Exmh_1564424968_8191P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Comment: Exmh version 2.9.0 11/07/2018 iQIVAwUBXT87CAdmEQWDXROgAQKamhAAm8hBFjp4ec2mt1Yn3Lv9h8V/Nkiwkwf+ DkjLWVlLBargsoIS2uYNukKzk65YdO+lguYqdRozoZJorqgEZLTG1sM6ZLO4JqDs ZJfY9a9T2kvmmiC8fuGeMhCUojbINJ16QxO6EDgx4yBhp9k+i0pnl5omd/6EKtny P+JA3rYlej037N6UR1c7/SIoenc3hCKvkZjCZq4BBTGdfipRoXgVd62PozgQ3gi/ B2PYF27fsttQdm+4mB8cb5gazdgqVF/r106PNa99YrEVGXbFiHOhpcBvzNVKzCDy StCT8xwNX9VjWOrZ5I4ttTb3pSBaKpO5/doDYGAuVIN/7NB0OJ2PvgTWAy4qLke4 S3rboOcW+sPiGmC7gWZi0VM8KYMiQllG+FIkSZb1IyfVbwWWvK25xR3EBJuCBiG7 TE5VhRLmsRVyW3hW/izTsJZ+1dIS8fMsS5Apz3jybn+NaYLf7VLentcLPl0hMwiK Z45U9BzYZYfSErrBmdRjLWyU8OFcwwoFaEBIL4qgcFuvpjEEqA9cMCKVtw7DTq4/ qPg0j0U/fjE5rySS+pJZENOppJDNGbbehrEnk9QOGXBeAqKTLwBniekTmnG1M5Rb u6BQyH2T+P05F6ODBVxQTDq8BnUMwvZgVcwCrKIJVqOrZLbBqokKCc1e/0Kbp6rG M4yV3Rk4SRY= =ejPP -----END PGP SIGNATURE----- --==_Exmh_1564424968_8191P-- --===============6278806291760488340== 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 --===============6278806291760488340==--