From owner-freebsd-hackers@freebsd.org Wed Jun 14 16:16:17 2017 Return-Path: Delivered-To: freebsd-hackers@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 59C6FBEE0B2 for ; Wed, 14 Jun 2017 16:16:17 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) (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 0FDB06ED17 for ; Wed, 14 Jun 2017 16:16:16 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-lf0-f51.google.com with SMTP id m77so5058110lfe.0 for ; Wed, 14 Jun 2017 09:16:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=WTAKBsgVe2KqK1OWbCLBrI/y0pUh6WkIE/jSTPsS/I0=; b=kLEJb10pCiMX5o3a45Aye/xFWdKEVDQrFuiq1TylcnLHOe7n0qXtIfi4ES4fSbUnBW +9W+1IlkPGl3DlL60HgtAdKAXWOwrYJpXY0f89iONh1QAC7D8gPbVr2vgq1ybWYUJthd uvVDnjTFhVzKyZWmfwQrkN3Q9rAIg2HhfHkpK01ByC2sYZTM8Jk8YAjKdLBK5pCbP2Lh +/TZT+Vs3jQgtseGCjD7YcOtMP4imb5q3lIpA36CNkxrKWfxfWBvvw6PRNMtcAJetmAS ZqkEtInv2MRkKTQpfgqyw49GAzSrzegtAKl8IRQO6hjIoK6cV4UhaZKCm2yIn772yF39 0dfA== X-Gm-Message-State: AKS2vOz37TQIM/ePSRrcY3laIm3WvkvxVEPetXk4dC2hCWlW7ytrxSoF cQUYbupKiRJbJ7ULvBA= X-Received: by 10.46.84.73 with SMTP id y9mr261790ljd.130.1497455122733; Wed, 14 Jun 2017 08:45:22 -0700 (PDT) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com. [209.85.215.51]) by smtp.gmail.com with ESMTPSA id e28sm80417ljb.58.2017.06.14.08.45.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Jun 2017 08:45:22 -0700 (PDT) Received: by mail-lf0-f51.google.com with SMTP id v20so4387158lfa.1 for ; Wed, 14 Jun 2017 08:45:22 -0700 (PDT) X-Received: by 10.80.180.188 with SMTP id w57mr567753edd.42.1497455122359; Wed, 14 Jun 2017 08:45:22 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.164.154 with HTTP; Wed, 14 Jun 2017 08:45:21 -0700 (PDT) In-Reply-To: <5940EA87.4030002@163.com> References: <5940EA87.4030002@163.com> From: Conrad Meyer Date: Wed, 14 Jun 2017 08:45:21 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Re: A question about in lock usage in FreeBSD To: Jia-Ju Bai Cc: Konstantin Belousov , "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jun 2017 16:16:17 -0000 On Wed, Jun 14, 2017 at 12:49 AM, Jia-Ju Bai wrote: > Namely, it is unsafe that the thread calls the function which may sleep when > the thread holds mutexes, reader/writer locks or read-mostly locks. > Is it right? Correct. sxlocks ("shared-exclusive," although I tend to think of the "s" as standing for "sleepable") can be held calling functions which may sleep. Best, Conrad