From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by dpdk.org (Postfix, from userid 33) id D1B2D4CE4; Tue, 14 Aug 2018 18:00:45 +0200 (CEST) From: bugzilla@dpdk.org To: dev@dpdk.org Date: Tue, 14 Aug 2018 16:00:45 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: DPDK X-Bugzilla-Component: vhost/virtio X-Bugzilla-Version: 18.08 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: seanbh@gmail.com X-Bugzilla-Status: CONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: dev@dpdk.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.dpdk.org/ Auto-Submitted: auto-generated X-Auto-Response-Suppress: All MIME-Version: 1.0 Subject: [dpdk-dev] [Bug 81] Use of rte_memseg_contig_walk in vhost_kernel.c causes deadlock X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Aug 2018 16:00:46 -0000 https://bugs.dpdk.org/show_bug.cgi?id=3D81 Bug ID: 81 Summary: Use of rte_memseg_contig_walk in vhost_kernel.c causes deadlock Product: DPDK Version: 18.08 Hardware: All OS: All Status: CONFIRMED Severity: normal Priority: Normal Component: vhost/virtio Assignee: dev@dpdk.org Reporter: seanbh@gmail.com Target Milestone: --- Deadlock can occur when allocating memory if a virtio_user device is in use. The execution path that causes is this is as follows: alloc_more_mem_on_socket(...); try_expand_heap(...); // RW Write Lock taken here... rte_rwlock_write_lock(&mcfg->memory_hotplug_lock); try_expand_heap_primary(...); eal_memalloc_mem_event_notify(...); virtio_user_mem_event_cb(...); vhost_kernel_ioctl(...); prepare_vhost_memory_kernel(...); rte_memseg_contig_walk(...); // Attempt to take RW Read Lock here... rte_rwlock_read_lock(&mcfg->memory_hotplug_lock); Replacing rte_memseg_contig_walk() with rte_memseg_walk_thread_unsafe() in prepare_vhost_memory_kernel() will remove the deadlock, but could cause iss= ues as prepare_vhost_memory_kernel() may also be called outside of memalloc eve= nt notify context. --=20 You are receiving this mail because: You are the assignee for the bug.=