From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48FE1C6FD1C for ; Fri, 24 Mar 2023 13:48:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C7D9C900006; Fri, 24 Mar 2023 09:48:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C2DA9900003; Fri, 24 Mar 2023 09:48:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AF516900006; Fri, 24 Mar 2023 09:48:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 9D464900003 for ; Fri, 24 Mar 2023 09:48:20 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 6AD3AAB2E2 for ; Fri, 24 Mar 2023 13:48:20 +0000 (UTC) X-FDA: 80603921160.13.70CDDF9 Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) by imf25.hostedemail.com (Postfix) with ESMTP id 81C65A0015 for ; Fri, 24 Mar 2023 13:48:17 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=joelfernandes.org header.s=google header.b=x0oemtBh; spf=pass (imf25.hostedemail.com: domain of joel@joelfernandes.org designates 209.85.219.182 as permitted sender) smtp.mailfrom=joel@joelfernandes.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1679665698; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=tlxb7IQ6LLDgiORswv/qEWs9yBORD5ICbT5uFlhAdGc=; b=XHrSjTK3X1BRy+CJC/nwzUOF2dkNyO9Wo9kwN872GbZwAJcR0tqdB27N6KmmayAV6PjpZF S/H4vCWD0VCIeiWZI9gugYK7HcdWCe5KACA8Y5pWBReboJho5b9A8myYleTJ5wBv9FdG+h roRo/nDinlWbhULtZO+BwQNyEaJdBnI= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=joelfernandes.org header.s=google header.b=x0oemtBh; spf=pass (imf25.hostedemail.com: domain of joel@joelfernandes.org designates 209.85.219.182 as permitted sender) smtp.mailfrom=joel@joelfernandes.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679665698; a=rsa-sha256; cv=none; b=duxIW+VjwIpcMXVOV/PuFtYB6P16SO+PNHl0TSI6NikMfoqfZjV92ED/VQzcQr7eKXaaa1 7eFN3J18GY1sXf1j3z5hVoRC9cNYYS1Xmb1rl4XP04jqVB8PlsynGi8romCZd8yDp8ihcf z2N36O/qgh/A9a5m+cuKhYpX/BW8TnU= Received: by mail-yb1-f182.google.com with SMTP id y5so2217023ybu.3 for ; Fri, 24 Mar 2023 06:48:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; t=1679665697; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tlxb7IQ6LLDgiORswv/qEWs9yBORD5ICbT5uFlhAdGc=; b=x0oemtBhzoiFQ9zWda8YdE4IseDam7CaY18ctp1AXcP7ra3LrMO9tKKr6KhxKPJd3l Cd4Z0SmWjI/+wnilZq7SchK5j4Geff5pvWrC1M9EzgYU4o+rTapdmUI4Rdg0R3lVd1AB Bn8dcgzZzsCVo1yd+pk9fPJEcPkXRPe/qqqjI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679665697; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tlxb7IQ6LLDgiORswv/qEWs9yBORD5ICbT5uFlhAdGc=; b=AnM1OU6qZdqbCWSgsQwC0dGYYiXdSYyhRy6YxDW4lRBihfnY8No/uml6QGsFynQKBm R0nAPFEUK95rPb+75NbCsFl2XbIwLbAyQrur0amPJuBiPEX2I4+T74/uarOksE3BA8b/ o9ElGQmiIzoX5Lcl7eJnfe+JiCr0uzpDdB+KO32EQDRC4rBwFJfjyS5OtBfwBQWKX87Q Gqx9pV4mzKC/uLgVtZAxUvoecTJjtSgC0vvOwcRUwg5oldCATxnmKV1aUJSlSbHOuvq/ 7RMzya+9vpQX9muQt9cjo9D0nfn5+hwggIvgB7nVCbsXZA8B7b/CRVymAM8TingO3b5o 5Lrg== X-Gm-Message-State: AAQBX9dRxT6GqirQwxegCSsYGxMjVcVou9MAUHU/zVk1Rpj33cN0wZl8 RedvuToD25qBwBb0GX9B5c4nOfSsl8knhArpZRXE7Q== X-Google-Smtp-Source: AKy350Y0Y+FOxa8FFx0ofJUqnL7e/TUq2l89UkZwjYNXRAkKDtrTBjVg9R6nGI2v46q4NjZOHtHAq+zXAL1AkTFMdCA= X-Received: by 2002:a25:680e:0:b0:b78:3a15:e6fe with SMTP id d14-20020a25680e000000b00b783a15e6femr343682ybc.2.1679665696958; Fri, 24 Mar 2023 06:48:16 -0700 (PDT) MIME-Version: 1.0 References: <20230324130530.xsmqcxapy4j2aaik@box.shutemov.name> In-Reply-To: From: Joel Fernandes Date: Fri, 24 Mar 2023 09:48:05 -0400 Message-ID: Subject: Re: WARN_ON in move_normal_pmd To: "Kirill A. Shutemov" Cc: Michal Hocko , Linus Torvalds , Naresh Kamboju , Andrew Morton , linux-mm@kvack.org, LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 81C65A0015 X-Stat-Signature: r9gxtgajc1wq8fr6uhdnrojai8sybyre X-Rspam-User: X-HE-Tag: 1679665697-164760 X-HE-Meta: U2FsdGVkX1/W7xLi+maHsRy+LBQYGH7uViwcTBF+eMrrXkQo4venm2newjKg27wXkE8WQIDafrYX8vJj4P6oX2WDFK5pUFTeKM7b6sBFnQhu/InDqx8oI1inI9c6YGoHin1x3+X2+Bpxxvi7TygUgwb37lab7kiXIB77NxKh0kv5/it3GidR03Mth5Unn1G+2U/dajty+URMuypPoB+CorynxNcYcAl9Y7wrQckKPXUGUUL+LdaWnwJOzwvTVnQpixjmBcnl+Cnja/OVlfMg9krQXfXyjcd+yJUVY8jpXM0iGWj66Ukpf3OKo9VQM24pay9utAUKHmj4KWF2QcEOKqyUqsHa48qJb4RZlSRM7m5Gn3KMlwSWeFZ7Xif33ownhd3PW1AFW6G0Rrsy2ou5bpb27VI/IJDpJ/ILiSYpJ8jD1PP9tKoLgZoognC33T/e8TWLu09JeALidu8SrpKGAxjMyqD9f+17YqYdsOyUjQqTVZK1iGHnA870Hycl50jvOLWf11+X0rIl0pPmG+gxFEVB894aeg3VXoBz+3VcS7kJbLANnnuCOu5viBlosMBTbfPVUMlH3QppE5aLkYXGPk2gX4KecRihwyftDLlKBptZenpGoRlq+D8CkOmw7MWGgmC+lsuKqVR+DQZFYaZcBXjqRQm0WNb2gxurNrYmAKTZ9P/ekXvS9v3FB4bDvFjlAZs8glgbNGY5l3mt9MW/WaKhHuPGhVhoagtlVP4vfaLXU2eVmsHvF+4G2+teRtfGTfuXyyTjcM1rhBq2MUNRbCfZ4Xa3o+5z2aPNhxCGG4833QvWH8LR8m4J8YMF9IsOmHvIBAtJoQ4piwvHmTFz/XxwvqWZIONg2vLBjAOULZLo75LwNBz3Y1HTRb1OktfIi6U4qHK3sGACsO4bCluCbjy977/JndP04n6A0TS0KcLyBiIxcfYbsr9XL923jvG5hMsyCyjvUkf/IxuIj6e fP18jjeK 83ful+J5utK1uwwLLvbcHX8FiJqbw/asO8UD8SZPltKOX7uyW/ACQFdX4nkJI3TrV15uRG8v+xx0Ys+/sOqovNc3rUBo2qe5rpkQaJXcyuRRHdtJXUtDUd8OXpDb0HnTv6vg+v2eZ5jZz7/MesNeU2YbAUCgm66eGLw5hGKVlNRgpOFyL73bFdeL7XD7/zHK40aiQam6whHmJhgmdc8Gj/aBYvewfCEteDVgOWyLoI+Jdrkb0ebsfr40kbHaRcUbp/TN5IYMjwqz9slvhEJi298nM+BCrAQvesQf1BTd9/QRbM+sh3L+WZtwTd+w5TsX52/gpexSaguFm1cK9PbEdbgLfyDvXyNAcvjOO X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Mar 24, 2023 at 9:43=E2=80=AFAM Joel Fernandes wrote: > > On Fri, Mar 24, 2023 at 9:05=E2=80=AFAM Kirill A. Shutemov wrote: > > > > On Fri, Mar 24, 2023 at 12:15:24PM +0100, Michal Hocko wrote: > > > Hi, > > > our QA is regularly hitting > > > [ 544.198822][T20518] WARNING: CPU: 1 PID: 20518 at ../mm/mremap.c:2= 55 move_pgt_entry+0x4c6/0x510 > > > triggered by thp01 LTP test. This has been brought up in the past and > > > resulted in f81fdd0c4ab7 ("mm: document warning in move_normal_pmd() = and > > > make it warn only once"). While it is good that the underlying proble= m > > > is understood, it doesn't seem there is enough interest to fix it > > > properly. Which is fair but I am wondering whether the WARN_ON gives > > > us anything here. > > > > > > Our QA process collects all unexpected side effects of tests and a WA= RN* > > > in the log is certainly one of those. This trigger bugs which are mos= tly > > > ignored as there is no upstream fix for them. This alone is nothing > > > really critical but there are workloads which do run with panic on wa= rn > > > configured and this issue would put the system down which is unnecess= ary > > > IMHO. Would it be sufficient to replace the WARN_ON_ONCE by > > > pr_warn_once? > > > > What about relaxing the check to exclude temporary stack from the WARN > > condition: > > > > diff --git a/mm/mremap.c b/mm/mremap.c > > index 411a85682b58..eb0778b9d645 100644 > > --- a/mm/mremap.c > > +++ b/mm/mremap.c > > @@ -247,15 +247,12 @@ static bool move_normal_pmd(struct vm_area_struct= *vma, unsigned long old_addr, > > * of any 4kB pages, but still there) PMD in the page table > > * tree. > > * > > - * Warn on it once - because we really should try to figure > > - * out how to do this better - but then say "I won't move > > - * this pmd". > > - * > > - * One alternative might be to just unmap the target pmd at > > - * this point, and verify that it really is empty. We'll see. > > + * Warn on it once unless it is initial (temporary) stack. > > */ > > - if (WARN_ON_ONCE(!pmd_none(*new_pmd))) > > + if (!pmd_none(*new_pmd)) { > > + WARN_ON_ONCE(!vma_is_temporary_stack(vma)); > > return false; > > + } > > Wouldn't it be better to instead fix it from the caller side? Like > making it non-overlapping. > > Reading some old threads, I had tried to fix it [1] along these lines > but Linus was rightfully concerned about that fix [2]. Maybe we can > revisit and fix it properly this time. > > Personally I feel the safest thing to do is to not do a > non-overlapping mremap and get rid of the warning. Or is there a [..] Aargh, I meant "not do an overlapping mremap", instead of "not do a non-overlapping mremap". :-) Thanks.