From owner-freebsd-stable@freebsd.org Thu Apr 13 00:21:05 2017 Return-Path: Delivered-To: freebsd-stable@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 80647D3B94F for ; Thu, 13 Apr 2017 00:21:05 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 616C2A8E for ; Thu, 13 Apr 2017 00:21:05 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 5DA2DD3B94C; Thu, 13 Apr 2017 00:21:05 +0000 (UTC) Delivered-To: stable@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 5D571D3B94B for ; Thu, 13 Apr 2017 00:21:05 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (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 EA4F5A8C for ; Thu, 13 Apr 2017 00:21:04 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wm0-x22a.google.com with SMTP id t189so35684325wmt.1 for ; Wed, 12 Apr 2017 17:21:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=K1Ia6xlIEiaVlIqSykYlLumPjSMSl/3chFR2sE2ndDo=; b=h2oxzIhgNp4m+r0dfGnKbCwDJPC/+sfcpqpfVyyr5/7+gsMiNwG+gNdtspRajOBhRT cFSvuf3b+59ECgfDh2ARM4lS26LxgIhbpMi8dftIWhFXUGWbamCXlwrEGqezzAS9pj41 zD8e9npVUG0ElUYZVqPXLOCR64K8hMRSYb1wAwT8RRiCG95ZxWJlTocKiSydVca4riBn //sT5QjzgtMUjO6Zn5bARJRiEzTekxZa3HVfsjKpmBQJPJyB0XEDTbsfrFXmNuK71NNW VDyP5x8HNtBf8ncb7hMZkg3RWgf7fIjlNjpGyzy98dt2OYrI39p1JV1OWyBJ6Vvqe/3P UJJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=K1Ia6xlIEiaVlIqSykYlLumPjSMSl/3chFR2sE2ndDo=; b=uGZjEKURKPx8K1zsLapCnwIVxVYlfozClgW2Tix5J6yAIZgLpLD4H3mNg6hL7fn452 bzBJ8v5iiIPXaIgZoEqrp3hVYsuyUc2Wv9Z5/8mCojlZ7tXr8HU6cW+tQK8FOOTTYnFQ 5fJAJrQLU0paPuDUAAvvkeybFPsgOBnRqPFm9WXSMQsDlOPsC7aIDQLeb2Zb/8ZhWyKQ gYLhy+VYtiGaPC4MTv/xDZ7fssMra0lZuUiajLIDOh76QO+575lnXOQ2GYV+Hs073rgL 59HuSiibgUUO6ezymfGIO4ZTc9V7NiT8EaAwI9IbEsp1TDPfz6RG8uji5vfF0o2oRLpn /2TQ== X-Gm-Message-State: AN3rC/4L3UodN6WmMcpAKKd7vNASDSQTvXBpK9Tfq+w7ErJatKzkOiEi 9YDAjTPFlCqUX5M9qJNMe9RQscmhhlv4 X-Received: by 10.28.0.78 with SMTP id 75mr609396wma.138.1492042863327; Wed, 12 Apr 2017 17:21:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.185.66 with HTTP; Wed, 12 Apr 2017 17:21:02 -0700 (PDT) In-Reply-To: <20170321164227.GE86500@zxy.spb.ru> References: <20170321164227.GE86500@zxy.spb.ru> From: Adrian Chadd Date: Wed, 12 Apr 2017 17:21:02 -0700 Message-ID: Subject: Re: Lock contention in AIO To: Slawa Olhovchenkov Cc: "stable@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 00:21:05 -0000 It's the same pages, right? Is it just the refcounting locking that's causing it? I think the biggest thing here is to figure out how to have pages have a lifecycle where the refcount can be inc/dec (obviously >1, ie not in a state where you can dec to 0) via atomics, without grabbing a lock. That'll make this particular use case muuuuch faster. (dfbsd does this.) -a On 21 March 2017 at 09:42, Slawa Olhovchenkov wrote: > I am see lock contetntion cuased by aio read (same file segment from > multiple process simultaneous): > > 07.74% [26756] lock_delay @ /boot/kernel/kernel > 92.21% [24671] __mtx_lock_sleep > 52.14% [12864] vm_page_enqueue > 100.0% [12864] vm_fault_hold > 87.71% [11283] vm_fault_quick_hold_pages > 100.0% [11283] vn_io_fault1 > 100.0% [11283] vn_io_fault > 99.88% [11270] aio_process_rw > 100.0% [11270] aio_daemon > 100.0% [11270] fork_exit > 00.12% [13] dofileread > 100.0% [13] kern_readv > > Is this know problem? > _______________________________________________ > freebsd-stable@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"