From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 17:36:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AD37678; Wed, 17 Sep 2014 17:36:06 +0000 (UTC) Received: from mail-la0-x232.google.com (mail-la0-x232.google.com [IPv6:2a00:1450:4010:c03::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05645D56; Wed, 17 Sep 2014 17:36:04 +0000 (UTC) Received: by mail-la0-f50.google.com with SMTP id ty20so2322636lab.23 for ; Wed, 17 Sep 2014 10:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=9ACu5/zmUrhBxqMhiH5Tq6YY6IiFjkNJPgJbQP11U2U=; b=P67UntCIDeoiTY4fpL7iDP1koEPCwkB77A9BtYo7lPznXcCiQIzp6WlyhxRYv1Q98Y QGNgyehfcNSIiO/yUh+D/vvOa5SQLqUt7oWwfxajIWk6GjLt+jLheobmKyTWMuu1wplz N0ngCiL2Ck/Sfaz6HFPutEtrWjQ8hWE4iTbb9D9dH9WiAV2Tpro+tds8pxzSg4Z8wbOG lOAQKXg8kK/zPj5yjfp+lRaxmDll+ltwz6ZFI7QNZSaIxZbQdKvhpsfVc9QYyHFOMHKQ kC6U7jkksrmGntmEBeoe7bKMciN8G0S3d6sicPxlh0+EvJvy8Q4vVD7/WpyyKj5+8O6F EiIw== X-Received: by 10.112.199.197 with SMTP id jm5mr42824512lbc.19.1410975362729; Wed, 17 Sep 2014 10:36:02 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by mx.google.com with ESMTPSA id vr9sm6366777lbb.36.2014.09.17.10.36.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Sep 2014 10:36:01 -0700 (PDT) Sender: Alexander Motin Message-ID: <5419C67F.90808@FreeBSD.org> Date: Wed, 17 Sep 2014 20:35:59 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Alan Cox , Andrey Chernov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r271707 - stable/10/sys/kern References: <201409171406.s8HE6LNu071461@svn.freebsd.org> <5419B3E1.1090703@freebsd.org> <5419BAD7.4000600@FreeBSD.org> <5419BFF9.9080907@rice.edu> In-Reply-To: <5419BFF9.9080907@rice.edu> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2014 17:36:06 -0000 On 17.09.2014 20:08, Alan Cox wrote: > On 09/17/2014 11:46, Alexander Motin wrote: >> On 17.09.2014 19:16, Andrey Chernov wrote: >>> On 17.09.2014 18:06, Alexander Motin wrote: >>>> + /* >>>> + * Make sure that tdq_load updated before calling this function >>>> + * is globally visible before we read tdq_cpu_idle. Idle thread >>>> + * accesses both of them without locks, and the order is important. >>>> + */ >>>> + mb(); >>>> + >>>> if (TD_IS_IDLETHREAD(ctd)) { >>> I don't understand this comment's first phrase with two verbs. Copy & >>> paste result? >> No, only possibly missing commas around "updated before calling this >> function". > > > Commas alone don't fix the problem. I think what you're trying to say is: > > "Make sure that our caller's earlier update to tdq_load is globally > visible before we read tdq_cpu_idle." Yes, that was my intention. Thank you. Please excuse my non-native English and correct it as you feel better. Andrey, would that reveal your questions? >>> I also don't see tdq_load access in this function. >> It is incremented by tdq_load_add(), called by tdq_add(), called by >> sched_add(), just before calling tdq_notify(). -- Alexander Motin