Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Nov 2022 19:53:04 -0800
From:      Mark Millard <marklmi@yahoo.com>
To:        Archimedes Gaviola <archimedes.gaviola@gmail.com>
Cc:        Warner Losh <imp@bsdimp.com>, freebsd-current <freebsd-current@freebsd.org>
Subject:   Re: 14.0-CURRENT failed to reclaim memory error in RPi 3B build
Message-ID:  <788B97E7-AA06-4A87-BB4A-CF2602DC1AD3@yahoo.com>
In-Reply-To: <CANCZdfruoDPQE%2ByqebDomg8w7YKCkbFPvrPweJQUqoaOMN3rwA@mail.gmail.com>
References:  <84376CC9-B991-4BF3-AF5F-0AA09CB28339.ref@yahoo.com> <84376CC9-B991-4BF3-AF5F-0AA09CB28339@yahoo.com> <CAJFbk7FfYPSe3eF00HgDdebW70HKp5zKR0JaChTVniUDPG2qxQ@mail.gmail.com> <CA350C16-3604-4D88-9C14-040A45F6F125@yahoo.com> <CAJFbk7Hxvr9gs7GnniWtJ-QEH4yjYbB9S-vKVLjipa8v5VHa%2Bw@mail.gmail.com> <CAJFbk7GQhvgQS-23jFfFf=ershgGNKByHR8ug08Df8merwkh6Q@mail.gmail.com> <A11AA52B-BDB0-43C7-BF85-3C252B276F17@yahoo.com> <CAJFbk7HnFTdzANtdERqvgX30hcHmufAZmrNvbfEWORkUJJ7_3w@mail.gmail.com> <CAJFbk7HJ1WA5Qc0LNEZpKgv78yiM0w7ex=gjgpjjTf3chhHhiQ@mail.gmail.com> <CANCZdfruoDPQE%2ByqebDomg8w7YKCkbFPvrPweJQUqoaOMN3rwA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Nov 7, 2022, at 19:28, Warner Losh <imp@bsdimp.com> wrote:
>=20
> . . .
> swap_pager: indefinite wait buffer: bufobj: 0, blkno: 256929, size: =
4096
> swap_pager: indefinite wait buffer: bufobj: 0, blkno: 3628, size: 4096
> swap_pager: indefinite wait buffer: bufobj: 0, blkno: 255839, size: =
40960
> pid 46153 (c++), jid 0, uid 0, was killed: a thread waited too long to =
allocate a page
> swap_pager: indefinite wait buffer: bufobj: 0, blkno: 255857, size: =
28672
> swap_pager: indefinite wait buffer: bufobj: 0, blkno: 3634, size: 8192
> swap_pager: indefinite wait buffer: bufobj: 0, blkno: 256037, size: =
4096
> swap_pager: indefinite wait buffer: bufobj: 0, blkno: 255320, size: =
8192
>=20
> This means that paging to the swap partition and/or swap file took too =
long (> 30 seconds... that's all that indefinite means).

FYI: I think the "indefinite wait buffer" bound that leads
to those messages is 20 sec (the hz*20 below):

        /*
         * Wait for the pages we want to complete.  VPO_SWAPINPROG is =
always
         * cleared on completion.  If an I/O error occurs, SWAPBLK_NONE
         * is set in the metadata for each page in the request.
         */
        VM_OBJECT_WLOCK(object);
        /* This could be implemented more efficiently with aflags */
        while ((ma[0]->oflags & VPO_SWAPINPROG) !=3D 0) {
                ma[0]->oflags |=3D VPO_SWAPSLEEP;
                VM_CNT_INC(v_intrans);
                if (VM_OBJECT_SLEEP(object, &object->handle, PSWP,
                    "swread", hz * 20)) {
                        printf(
"swap_pager: indefinite wait buffer: bufobj: %p, blkno: %jd, size: =
%ld\n",
                            bp->b_bufobj, (intmax_t)bp->b_blkno, =
bp->b_bcount);
                }
        }
        VM_OBJECT_WUNLOCK(object);

But the "was killed: a thread waited too long to allocate a page" is
tied to a total of 30 sec (3*10sec) from:

vm.pfault_oom_attempts=3D 3
vm.pfault_oom_wait=3D 10

(Presuming that you had defaults at the time.)

> It also means that it can't write to backing store dirty pages to give =
to another process...
>=20
> Typical reason is that the disk / flash is not responsive to writes =
for some reason. You'll need to find why... I'd look at trims.
>=20
> Or.... if you can't change the disk... you need to put less memory =
pressure on it..





=3D=3D=3D
Mark Millard
marklmi at yahoo.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?788B97E7-AA06-4A87-BB4A-CF2602DC1AD3>