From owner-freebsd-current@freebsd.org Thu Jan 2 14:16:52 2020 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C89C91D052D; Thu, 2 Jan 2020 14:16:52 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47pVTb4Xk2z4Sgr; Thu, 2 Jan 2020 14:16:51 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x844.google.com with SMTP id d18so32049741qtj.10; Thu, 02 Jan 2020 06:16:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=XK55SPCdSSATJL8TZbbKfkavp3TxuT/wIHBpfG5n14Y=; b=b3Y5mCI2pSVGtKs/i+O/jjfc8kd3tVkaGXAlb8ruUxE5nR6Ad/391RJc8U7Yr9dZYz psojNyLujZY+tzSMecaZo+7pmHosbZOV/0XXH7qZFV48uK+GUwyKgSN5B9rMBJeqjGjo 6si2uft9FaXsg/pnkMzcWK30oIqLK9JR8rhJTtfB7lOT//Nwm3o8HvTBp6JCI7NU3yP6 X4DxUvZHPXdbUJhE+5yzYY11HmAFPoYtrWbubXp9mVf4paffcSo30lTV/X+ZAPluccuO fbvO+HWn3ZhtIwTfzVIm5wu5ZrEw4l0UvEnv7A6f13OCTl0kO/Y8+bcLq3GWl9h55ih1 alsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=XK55SPCdSSATJL8TZbbKfkavp3TxuT/wIHBpfG5n14Y=; b=VweX1VHeJLHrZdNmWnw8/Tuxl6bjjbS1piOEw1yppgJBSrJLcza7AFp9VAVAXp7E/E TGSDqLO6fnOuUJ3b87Sx/x7DGr0osVX+SYx+7wrWMi1YVNkHbGk68QPNLb/grHOzkr4B p2BOgNwyDgHmmIT8WzpSj4T70hxMrJgYHg34IlpLunHZ5qVA1n4zlRaVOQiYRe0vlVL7 WmTW8jbNcjwsSqqpvsE27VDzRA/j1Ki7Xn9EGmFAnCrGt2O58LJhCEI6RjKvoQrm3rv9 AmlouAAkTWTB2Pb2js8P8dBBB1l59/0mXj9QA9IXUk1KF62ORT2xd+VkU9yPogtPB+dh bMLQ== X-Gm-Message-State: APjAAAX/u2SGsQafDJcXY6vHtoeqXqfSAaFKkuOAvobMf/EYZW8k11LB I0JUwnG9m07sdK9hqxqy6Xm3c6Fh X-Google-Smtp-Source: APXvYqySmHqDReLs0excxaFRS+cyfL3ikEUAScqwmI/wQo9zdMnAellUX9NYALMDDJzJvqfADhQZkQ== X-Received: by 2002:aed:3c12:: with SMTP id t18mr62183448qte.140.1577974610434; Thu, 02 Jan 2020 06:16:50 -0800 (PST) Received: from raichu (toroon0560w-lp130-05-69-158-183-252.dsl.bell.ca. [69.158.183.252]) by smtp.gmail.com with ESMTPSA id x8sm15141313qki.60.2020.01.02.06.16.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2020 06:16:49 -0800 (PST) Sender: Mark Johnston Date: Thu, 2 Jan 2020 09:16:47 -0500 From: Mark Johnston To: Idwer Vollering Cc: Michael Tuexen , bob prohaska , freebsd-arm@freebsd.org, freebsd-current Subject: Re: panic: vm_page_astate_fcmpset: invalid head requeue request on RPI3 Message-ID: <20200102141647.GB71506@raichu> References: <20200102001231.GA84583@www.zefox.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 47pVTb4Xk2z4Sgr X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=b3Y5mCI2; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::844 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-2.04 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[4.4.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-0.34)[ip: (2.34), ipnet: 2607:f8b0::/32(-2.14), asn: 15169(-1.87), country: US(-0.05)]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; FREEMAIL_TO(0.00)[gmail.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jan 2020 14:16:52 -0000 On Thu, Jan 02, 2020 at 02:58:16PM +0100, Idwer Vollering wrote: > This can happen on amd64, on r356262, too. > > $ kgdb /boot/kernel/kernel vmcore.0 > GNU gdb (GDB) 8.3.1 [GDB v8.3.1 for FreeBSD] > Copyright (C) 2019 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. > Type "show copying" and "show warranty" for details. > This GDB was configured as "x86_64-portbld-freebsd13.0". > Type "show configuration" for configuration details. > For bug reporting instructions, please see: > . > Find the GDB manual and other documentation resources online at: > . > > For help, type "help". > Type "apropos word" to search for commands related to "word"... > Reading symbols from /boot/kernel/kernel... > Reading symbols from /usr/lib/debug//boot/kernel/kernel.debug... > > Unread portion of the kernel message buffer: > panic: vm_page_astate_fcmpset: invalid head requeue request for page Sorry for the breakage. I believe the patch below will fix the problem, I am testing it now. diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 1e74f5c4c6db..cbdab1374f72 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -834,6 +834,7 @@ vm_pageout_launder(struct vm_domain *vmd, int launder, bool in_shortfall) if (new.act_count > ACT_MAX) new.act_count = ACT_MAX; + new.flags &= ~PGA_QUEUE_OP_MASK; new.flags |= PGA_REQUEUE; new.queue = PQ_ACTIVE; if (!vm_page_pqstate_commit(m, &old, new)) @@ -1313,8 +1314,9 @@ vm_pageout_scan_active(struct vm_domain *vmd, int page_shortage) */ ps_delta = 0; if (old.queue != PQ_ACTIVE) { - old.queue = PQ_ACTIVE; - old.flags |= PGA_REQUEUE; + new.flags &= ~PGA_QUEUE_OP_MASK; + new.flags |= PGA_REQUEUE; + new.queue = PQ_ACTIVE; } } else { /* @@ -1350,6 +1352,7 @@ vm_pageout_scan_active(struct vm_domain *vmd, int page_shortage) ps_delta = 1; } + new.flags &= ~PGA_QUEUE_OP_MASK; new.flags |= PGA_REQUEUE; new.queue = nqueue; } @@ -1560,6 +1563,7 @@ vm_pageout_scan_inactive(struct vm_domain *vmd, int shortage, if (new.act_count > ACT_MAX) new.act_count = ACT_MAX; + new.flags &= ~PGA_QUEUE_OP_MASK; new.flags |= PGA_REQUEUE; new.queue = PQ_ACTIVE; if (!vm_page_pqstate_commit(m, &old, new))