From owner-svn-src-all@freebsd.org Sat Feb 4 19:56:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C743DCD155E; Sat, 4 Feb 2017 19:56:44 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qt0-x243.google.com (mail-qt0-x243.google.com [IPv6:2607:f8b0:400d:c0d::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C846C53; Sat, 4 Feb 2017 19:56:44 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by mail-qt0-x243.google.com with SMTP id w20so10041538qtb.1; Sat, 04 Feb 2017 11:56:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version; bh=5y8bwiMsyQEfw48sVCUuCpy5bi/F/El656V/XsUAbYc=; b=B3pwtjYmNGsmnYcOxoVpVt4dGXKlnwW9hn50qT6KLB5/HS3JEd+67xLuvJ2/QRwlL/ YfFxir7PaVLQyOXr/yI7YrCQzTRO7gh5cxbQpaCkKZz9Q0t0/gHBkoGyk7mfhh+6L2LX OAsy08XideK/jDV4Vfw/gF9GgAMDAFdB5sY+OfnJzDCrhrDxJd5eWRHiBJpE0FcGzwZt ny+nE67orPxSttZvLBZvh4YWc5JmRbZ8BAjSO3cl5Wxa4DbrC+zb2t5Sqyab43THZdhe tynT0pu4B0A+Q4Dzrw+fXTe88vr4MQYAWFiyZm5mPZrKiyJMzHlNNqMBtNkI+1BBd2QD Nb/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version; bh=5y8bwiMsyQEfw48sVCUuCpy5bi/F/El656V/XsUAbYc=; b=L60QGhuyuCtwjlTplnIvDzpImbYBffIizhnmiLIIriXvYLKV0R9qJ51ymetRcrkqen gT+PxoLsnTZ91RTLPqCx85uAK5ydVnvDlb6mpI8F7AEXgUXkQC2D6XBfGR4YH5wiIkuc 2BGgCG+uXaG0t6dzinPc7vSAv25vSu5aJlMS7QGuhsMepEx1SEMl1HLKnwjX4D1NUtSN WvO1fGS8t9B7taFzqLA0MJ1ZxG1ZsxHWkytpycnh1eAGqVL/WbVVZExMhbwqjkjwbMUA Upahlql8n7PePi0oRXxbE+41SgJQ8fw1mgpUjqkWh831rZnMcVJMJQj1TN8G6JCjb8ZO GNaQ== X-Gm-Message-State: AMke39lZ3wZSZ0nZT2xz+8bODp5IiW0NiEdOpN22Fi/mQ7TaR7hXHa0Kk4EnS63miRkugw== X-Received: by 10.237.33.209 with SMTP id m17mr3289440qtc.59.1486238203435; Sat, 04 Feb 2017 11:56:43 -0800 (PST) Received: from kan ([2601:18f:802:4680:226:18ff:fe00:232e]) by smtp.gmail.com with ESMTPSA id h124sm28386818qke.40.2017.02.04.11.56.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 04 Feb 2017 11:56:42 -0800 (PST) Date: Sat, 4 Feb 2017 14:56:37 -0500 From: Alexander Kabaev To: "Jason A. Harmening" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Andreas Tobler , Kurt Lidl Subject: Re: svn commit: r313037 - in head/sys: amd64/include kern mips/include net powerpc/include sparc64/include Message-ID: <20170204145637.0324f015@kan> In-Reply-To: References: <201702010332.v113WnYf041362@repo.freebsd.org> <20170203231238.0675c289@kan> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/tT+G97w/.cXn85LaPanxYVX"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 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: Sat, 04 Feb 2017 19:56:44 -0000 --Sig_/tT+G97w/.cXn85LaPanxYVX Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 3 Feb 2017 21:29:33 -0800 Jason Harmening wrote: > Hi, >=20 > I'm a bit confused as to how this change breaks MIPS. The new > function, get_pcpu() is intended to be used only to access the > per-cpu data pointer locally. It returns pcpup, which is the per-cpu > pointer wired into the local TLB to translate to the local CPU's > physical data region, correct? >=20 > This is the same value used by the per-CPU accessors such as PCPU_ADD > and PCPU_GET. The MI portions of this change only use get_pcpu() to > access the local CPU's data, e.g. under a critical section in the > rmlock. It is not intended to be used for iterating all CPUs. >=20 > If I've missed something and MIPS is truly broken by this, then I'll > gladly revert, but (maybe because it's late) I'm not seeing where > this goes wrong on MIPS. >=20 > Thanks, > Jason The hang is actually due to _rmlock_assert spinning in rm_trackers_present with interrupts disabled, due to this constructs: for (queue =3D pc->pc_rm_queue.rmq_next; queue !=3D &pc->pc_rm_queue; queue =3D queue->rmq_next) { You changed the code to pass get_pcpu() results instead of direct pointer to the corresponding pcpu storage and that is NOT the pointer that was being used in pcpu_init. On architectures that rig TLB to make local PCPU available at constant address from each CPU, these two are generally not same, so while empty pc_rm_queue is a cyclic list consisting of just one element pc_rm_queue, the loop terminating condition will never be met, as &pc->pc_rm_qeue value will be very different from the one that pc->pc_rm_queue.rmq_next was set at initialisation time. This affects MIPS in SMP configuration only, UP configs do not bother with TLB hackery. --=20 Alexander Kabaev --Sig_/tT+G97w/.cXn85LaPanxYVX Content-Type: application/pgp-signature Content-Description: Цифровая подпись OpenPGP -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEExffZlZm2QeE8UVaRBxMimZJ5Ln4FAliWMfVfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEM1 RjdEOTk1OTlCNjQxRTEzQzUxNTY5MTA3MTMyMjk5OTI3OTJFN0UACgkQBxMimZJ5 Ln7gZg/+OrJ/rUQ+gm0P5DzMAf7aZ4rSOVNe244TWr+3Vu69zCEY9290HzxvKGd1 IhNY2P+4s5OFzbtYm/3ppjSrIziYr/hhIR0ZglunBEzsKtMwMGM2/mmi0n8fkMJW Ls0ndnQLgpNvInf6hKgvumqoxW/ak+WIet4AgqRfETPl5NfEHmaPKtrXT6qapP4c 8lGD1Lg4Sv/nOI7/VkeULMWXxGY9opFTZ08x68jOJKtxgNO/7g9D9LKg2JlO0FED GPA50APGetUuzkxLAItOYx1zr6SDeZqkwOokBr8gAbL4OI2oTND7lIFdqn+gkJM0 UCGul7AtgwOOSHsDp31rVok5OEs12S4AGb8RY5aRkG03g6NsCTY06JpvmbLI9S3e WvC/18ZSqVPjq7HkZnK2bSBwF3pwq2uIAXuKy8+0WCRn8d7OrW0+w4d5HaT58ACh XfadjjgCf8nBe7cde7AmckORU7cCGqV0ik8RVDUoqVgEGbqbOBHn8xXhCFoON00T nRUpHgzhYqWRX0MJ8Br800MXbNx/Dv/uljI6tfhF75+39TOOdQItdB7jpllvf+ox NmFbvQxVAJ5ShYEDprj4yEZuJKmxVZn7v4zaHCIJLAr+KQEl0OQAH2LiXSdPtPa7 eWZ87NIFjHmvIRTa8m7y8JWqXe1Rbvk7Ckq3h28/hUul+q0fALA= =kIAL -----END PGP SIGNATURE----- --Sig_/tT+G97w/.cXn85LaPanxYVX--