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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4C08C433F5 for ; Wed, 6 Oct 2021 19:54:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7FCE561152 for ; Wed, 6 Oct 2021 19:54:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7FCE561152 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 130B1900004; Wed, 6 Oct 2021 15:54:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E083900002; Wed, 6 Oct 2021 15:54:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F10B8900004; Wed, 6 Oct 2021 15:54:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id DE1CE900002 for ; Wed, 6 Oct 2021 15:54:21 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A20E38249980 for ; Wed, 6 Oct 2021 19:54:21 +0000 (UTC) X-FDA: 78667064322.32.B9509A8 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf12.hostedemail.com (Postfix) with ESMTP id 0D419100218A for ; Wed, 6 Oct 2021 19:54:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633550060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xnVRUaB8vdHCAs3GIdbbJkvM/qgvDDY4/1PeZEPVaUU=; b=J8vG5koDIH1U/3HZCrN5RuFS7eQi45ZN7mqWPId47LGD7zuuihUTeZ0ijaHRKesaBfZ71K kf2BOt8ANuGAA1LS2NC9/1BgmH8Q/ZGFGMljqR34vOz+sPr5vQXYKBFqCCyuV0n3kIrtFF kxu5VPEIvou7CsgKdV1eRI2w1xh1btQ= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-394-J0qD1sf8MxunIGQNJPASmA-1; Wed, 06 Oct 2021 15:54:19 -0400 X-MC-Unique: J0qD1sf8MxunIGQNJPASmA-1 Received: by mail-qk1-f198.google.com with SMTP id v17-20020ae9e311000000b0045ecf8d62fdso3008734qkf.22 for ; Wed, 06 Oct 2021 12:54:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xnVRUaB8vdHCAs3GIdbbJkvM/qgvDDY4/1PeZEPVaUU=; b=hKDNO9o9RNcTyHQfPwXDhA9rDuMb4mlk0/cT5x7UaGbXzacwXSRtxRlL8hD4em456K 9siTt8w6oIlx8EjO0PeSFWnzXG7coqpZ47qnyCZUHqFispbwzUrxDhCdT3bGA3qcMD76 0NRem/fEzzIcBbYiDIVCK0V7cwQY63d99dXYbRFw2wi6J8XevhNRIrTlveAw4KjJmttQ oXBlB9g09gQrvadWBBPU7ceTQgJ6wLTP/Ru49GpHE0PqFozw5gY6XYDk4wR3fj+OfRZ8 ZxRL8bMuCVpy7O7rku0ctKGkm8pLqq/58zbNny7RlC1ja9SuP6MTPo59S6KTtVUhm43z 9O/g== X-Gm-Message-State: AOAM5310NwHqgUTedwZdb6xpMmaWo0KiPaHw0bu0fQlnhO1nHivqOS7I oilCRgz4i8DNePrwLurHpjLfihRPLaIZ/2zBUPH/xpGa8pvpm2ZxiLLxUp+Empf4WFAPb4NAowb ik15sjklMagw= X-Received: by 2002:ac8:7e87:: with SMTP id w7mr136150qtj.166.1633550058703; Wed, 06 Oct 2021 12:54:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxud61YtiV9SX04xSMvTTTcQStB2UjjRUVAnxjj7QxgycMhC+ivJ4xXmzGMmXrNEC//a6L0A== X-Received: by 2002:ac8:7e87:: with SMTP id w7mr136117qtj.166.1633550058362; Wed, 06 Oct 2021 12:54:18 -0700 (PDT) Received: from t490s ([2607:fea8:56a2:9100::bed8]) by smtp.gmail.com with ESMTPSA id b13sm3355666qkh.134.2021.10.06.12.54.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 12:54:17 -0700 (PDT) Date: Wed, 6 Oct 2021 15:54:16 -0400 From: Peter Xu To: Yang Shi Cc: "Kirill A. Shutemov" , HORIGUCHI =?utf-8?B?TkFPWUEo5aCA5Y+jIOebtOS5nyk=?= , Hugh Dickins , "Kirill A. Shutemov" , Matthew Wilcox , Oscar Salvador , Andrew Morton , Linux MM , Linux FS-devel Mailing List , Linux Kernel Mailing List Subject: Re: [v3 PATCH 2/5] mm: filemap: check if THP has hwpoisoned subpage for PMD page fault Message-ID: References: <20210930215311.240774-1-shy828301@gmail.com> <20210930215311.240774-3-shy828301@gmail.com> <20211004140637.qejvenbkmrulqdno@box.shutemov.name> <20211004194130.6hdzanjl2e2np4we@box.shutemov.name> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=J8vG5koD; spf=none (imf12.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 0D419100218A X-Stat-Signature: 81njhcgekmk943sdzxdrihuxtn7k58kx X-HE-Tag: 1633550060-509611 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 Mon, Oct 04, 2021 at 01:13:07PM -0700, Yang Shi wrote: > On Mon, Oct 4, 2021 at 12:41 PM Kirill A. Shutemov wrote: > > > > On Mon, Oct 04, 2021 at 11:17:29AM -0700, Yang Shi wrote: > > > On Mon, Oct 4, 2021 at 7:06 AM Kirill A. Shutemov wrote: > > > > > > > > On Thu, Sep 30, 2021 at 02:53:08PM -0700, Yang Shi wrote: > > > > > diff --git a/mm/filemap.c b/mm/filemap.c > > > > > index dae481293b5d..2acc2b977f66 100644 > > > > > --- a/mm/filemap.c > > > > > +++ b/mm/filemap.c > > > > > @@ -3195,12 +3195,12 @@ static bool filemap_map_pmd(struct vm_fault *vmf, struct page *page) > > > > > } > > > > > > > > > > if (pmd_none(*vmf->pmd) && PageTransHuge(page)) { > > > > > - vm_fault_t ret = do_set_pmd(vmf, page); > > > > > - if (!ret) { > > > > > - /* The page is mapped successfully, reference consumed. */ > > > > > - unlock_page(page); > > > > > - return true; > > > > > - } > > > > > + vm_fault_t ret = do_set_pmd(vmf, page); > > > > > + if (!ret) { > > > > > + /* The page is mapped successfully, reference consumed. */ > > > > > + unlock_page(page); > > > > > + return true; > > > > > + } > > > > > } > > > > > > > > > > if (pmd_none(*vmf->pmd)) { > > > > > > > > Hm. Is it unrelated whitespace fix? > > > > > > It is a coding style clean up. I thought it may be overkilling to have > > > a separate patch. Do you prefer separate one? > > > > Maybe. I tried to find what changed here. It's confusing. > > Yeah, maybe. Anyway I will separate the real big fix and the cleanup > into two patches. This may be helpful for backporting too. Or maybe we just don't touch it until there's need for a functional change? I feel it a pity to lose the git blame info for reindent-only patches, but no strong opinion, because I know many people don't think the same and I'm fine with either ways. Another side note: perhaps a comment above pageflags enum on PG_has_hwpoisoned would be nice? I saw that we've got a bunch of those already. Thanks, -- Peter Xu