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 7114BC001E0 for ; Mon, 23 Oct 2023 14:16:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D5DC56B00D3; Mon, 23 Oct 2023 10:16:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D0DF26B00D4; Mon, 23 Oct 2023 10:16:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD5D26B00D5; Mon, 23 Oct 2023 10:16:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id AEA306B00D3 for ; Mon, 23 Oct 2023 10:16:41 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 5291EC0A53 for ; Mon, 23 Oct 2023 14:16:41 +0000 (UTC) X-FDA: 81376927002.06.7769589 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by imf01.hostedemail.com (Postfix) with ESMTP id 39B5F40014 for ; Mon, 23 Oct 2023 14:16:38 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b=ioH2Izgs; dmarc=pass (policy=none) header.from=linaro.org; spf=pass (imf01.hostedemail.com: domain of dan.carpenter@linaro.org designates 209.85.128.42 as permitted sender) smtp.mailfrom=dan.carpenter@linaro.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698070599; a=rsa-sha256; cv=none; b=E43omSe1qjgX+elBYp/uTUZd16m3mGlEZ1hmFTB4J2bKXVzfJGE9q6Ryw+jQHT8La/Uqrf QsGsd6wWlTd35H8Xi2aeFfSjwe1vgTt4mILBFB+0oithxy7bxYR2XfDrWf0gikif6NiS1o tmU94US8taaH9dFTWznIe/DqgvmChz4= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b=ioH2Izgs; dmarc=pass (policy=none) header.from=linaro.org; spf=pass (imf01.hostedemail.com: domain of dan.carpenter@linaro.org designates 209.85.128.42 as permitted sender) smtp.mailfrom=dan.carpenter@linaro.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698070599; 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=T5iW1K0Yi1e4FvpckzyR1RHnUVcBJrUNHSLAnahLGys=; b=Fd1PyIdmTeeuRkyWmE8ZmxU91clVRnDN8jaiJZefjuHDlD0zQoGutjvpFhi5Xs/+KypToU gAUMLStsL3KoDEJ0KMqtdKLeKUMsD31czJ89eQPIMTByjJBescZ8MIc5ZAZ1/eeOHugXb5 egfjY91QSTw1w8A5cIj4TLdR1UxUQV0= Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-40806e40fccso24629775e9.2 for ; Mon, 23 Oct 2023 07:16:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698070597; x=1698675397; darn=kvack.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=T5iW1K0Yi1e4FvpckzyR1RHnUVcBJrUNHSLAnahLGys=; b=ioH2Izgsk0THMuXEvP+I4b+gNL5LF9+xEktLKZr7SN0Pfmw0RsVR2H4VNa4csO/PE6 +fz8JYAKHPEmg4sXONbmrcNHeFs21LHJLyqrnzyBMqBlEVf985pdZ/2KlJJjTfSUIG9b 2rdJkatp4YrnvM96UzXyjJtTL/0CbdpHbf3ad5NPV4QFb5jL7WmGLxyhi67y26sk0wBu 8N8gRxSRan/CDmG/OGwwzoCJclDlon6FaC694LEbNsFBCTb0AxBwiPgtXXGx3ORDvlRI NpI4X3eqyMPZH2aZKN1QPsHl9H34XdWg6ezYwIOnvqq/axJRzEYLm4vZHNlzyiw5YgOp V7aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698070597; x=1698675397; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=T5iW1K0Yi1e4FvpckzyR1RHnUVcBJrUNHSLAnahLGys=; b=JCjkRO0HgZ2g7KyOsVJAC4Vv0+vHXQTFjt79KduDNrPShMma5V7ghFiDL40LiWWxrO L5eI1mujowoGiUP/6v2QpmQy17N48t2J8mw6a/4H5vNsbi8qizMPSm0Q3cgqkJc28rl4 0oJ9XGbDMTZ6fhEMSExrEwtY40RNrOtFvDKamxcBXN/GN/7aKu+qp0uYdOInnpWeQjIc C9NFgsbo4OGlB46ETT3yFIyJ/4asNT1f8lqOWj04zt+3tYSE+OPG2i0PkZjoQtfJ22d0 w81VaUJawxF3NPfYc9AZLYR3Fh5ycMjyQ/8LBmZ9J0u2uT0DD3F833jRDqjpSZCODcVO R4iw== X-Gm-Message-State: AOJu0Yy1x/lx+I3DIw/4cT7J3eRwqLrczuPIJCGLFmGlqmh8y4Rj6YBI zprbXtT6PPzG1DF8ZLPd3c/+Fg== X-Google-Smtp-Source: AGHT+IGGx/yvYrzQl788u+y8LS+2FpbnKdDk7w1H7ljsv4zkDSMMW+8W9HvMhJoIrmPWNrr/x050+Q== X-Received: by 2002:a05:600c:3555:b0:3f9:b430:199b with SMTP id i21-20020a05600c355500b003f9b430199bmr7149362wmq.15.1698070597552; Mon, 23 Oct 2023 07:16:37 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id i18-20020a05600c481200b00407b93d8085sm14105092wmo.27.2023.10.23.07.16.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 07:16:37 -0700 (PDT) Date: Mon, 23 Oct 2023 17:16:33 +0300 From: Dan Carpenter To: Vishal Moola Cc: Andrew Morton , linux-mm@kvack.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH 2/2] mm/khugepaged: Fix a NULL vs IS_ERR() bug in collapse_pte_mapped_thp() Message-ID: <0003b576-e63f-440a-ab24-739c0557dfb8@kadam.mountain> References: <0882a964-770e-418c-9c34-1a64195baafc@moroto.mountain> <20231020093626.bae70759c0f0fe5ee5159eae@linux-foundation.org> <183a70ee-cf95-4101-b89b-e274c210229f@kadam.mountain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <183a70ee-cf95-4101-b89b-e274c210229f@kadam.mountain> X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 39B5F40014 X-Stat-Signature: uyh4jfa76qz91r8hngjihdyhcg81ia8p X-HE-Tag: 1698070598-83269 X-HE-Meta: U2FsdGVkX18hLrrOHypKpHo37Kfp/0Y7mRqveOWS/rTqX9mRpj7KelfTK4GSUn4nHMUml/dLofVrdCfxOQMdAUzb/KlaPg8A9H0Tkvc/BDiTKTqDCJTd5kffEJuVlg3HLZ+oT6t5qQWrtCxREiitN7aOmNNO5Yyf9VBnxb9WY6i79nLAV6RYt2dlkgPugmxRExS65ObDnOq4py9zWY37wqCCQEg1YnmyZO7eXGs3lf6do3vNSNc9PNacJj846zm8T8NfjuFxsVb69h6v796I6JOHfTnpp4pUew3W+0tzT72/YKMPHc21D2LyxRT22d+K4JhJNrnDVB0La36kdTNH4K5ea8hSOSLIMrMng7EGXypjzYnkWNoPaIx1m7vcfzP1QnktKcl8CD8eYDg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pmGlTf2BSN7iA0PFzGQgFV++CZ/KR21VNWEEKN2Iw5XiC7E9aGIMywAYg40MP0g0p0YmYFJw7ZfFjc+U4khsYtOEUVTN9vlMfHaPCQ5wH2AujzIV12DkgjDo5xr4z20phLqt7vaLfuVt16FXYN2LpYb0LlRdTmnb9sb+hUP9BZRi4FlRf07I 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: List-Subscribe: List-Unsubscribe: On Mon, Oct 23, 2023 at 07:59:12AM +0300, Dan Carpenter wrote: > On Fri, Oct 20, 2023 at 09:49:15AM -0700, Vishal Moola wrote: > > On Fri, Oct 20, 2023 at 9:36 AM Andrew Morton wrote: > > > > > > On Fri, 20 Oct 2023 17:14:36 +0300 Dan Carpenter wrote: > > > > > > > This was changed from find_lock_page() which returns NULL to > > > > filemap_lock_folio() which returns error pointers. Update the > > > > error checking to match. > > > > > > > > --- a/mm/khugepaged.c > > > > +++ b/mm/khugepaged.c > > > > @@ -1508,7 +1508,7 @@ int collapse_pte_mapped_thp(struct mm_struct *mm, unsigned long addr, > > > > > > > > folio = filemap_lock_folio(vma->vm_file->f_mapping, > > > > linear_page_index(vma, haddr)); > > > > - if (!folio) > > > > + if (IS_ERR(folio)) > > > > return SCAN_PAGE_NULL; > > > > > > > > if (folio_order(folio) != HPAGE_PMD_ORDER) { > > > > > > Also doesn't appear applicable to current kernels? > > > > Thanks for these. Both these fix patches address issues introduced by my > > khugepaged folio conversion patchset: > > https://lore.kernel.org/linux-mm/20231018203213.50224-1-vishal.moola@gmail.com/T/#t > > > > Andrew already dropped the patchset from current kernels so I can fix a > > couple issues, v3 will include all these fixes. > > > Only this one was introduced by your patchset. The other bug is older. > I don't know why it only showed up as a new bug now. I had guessed that > it was other changes I had made to Smatch which affected this. Heh. Nope. I was wrong. These were both introduces as part of the folio conversion patchset. Thanks for taking care of this, Vishal. regards, dan carpenter