Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3124888imm; Mon, 16 Jul 2018 22:33:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdlokA9kju3mFl8BlltcPcPbBMqzYesexrwdBHGl3QmyGzPn5S2JYcpO8z6rDY4eLUMZ4xW X-Received: by 2002:a63:65c2:: with SMTP id z185-v6mr189450pgb.276.1531805618507; Mon, 16 Jul 2018 22:33:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531805618; cv=none; d=google.com; s=arc-20160816; b=wZGzETNDYSIY2O0Jt9cOaqC9tpVcbXMrKeXLUcGgV3I5VnCfmkF2JKXXzjGEu7CgLH DuFLs8Q2HE1EnsBAU1HTpxT21MECUVxEr5TzMvq344aoU9Z0lu5+xBMFLj8y+DEPOG4L 6T7uzbkFEjGz0guULo6MJwWy14I0YtVg4EUofrDvpRnUdvc0GMQKSCVG3KR1F7RXh0Ss U0V/0afVvANyQQL6XUtOLVixqZtrVqjjW+a4jrCDCNgpb4HMTBzpzBhiPgcbhGdbDPOB /d8RXo4lHcV3ZhK9zAlAt9fCbKshsYmVKSw9D4Q8oo67As0JxzWjirPynJJ/AF8czk0l 7kwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=1IjHaOgEjZD2spV2dDvxU8iK7OSWSfmBppTX7LrDDHY=; b=Z//jLzkVQ67/pZQhW0ylXU9OL9k6Ve7KQbiFdSg4MYB174CIYD48Uf4zH17AOMsf53 7NFOAzJwNVTqvBjHyKsqTEP4mus+ynb/5LHttPgRUQ9qftl6Ecc0YhprncnYabisUiWN I5uOAhFlUqMW/XmHOTj4CGvHePya3BBHIVsniG9sUvB+jm+jiTNIlO7kwd0q6HKW72mN IUT3JElVLIU8AWOI7aNP7I5QzP0YEfbTdGXrkXIMk47Kp+yJAi5p+ybl1pZbDPpf82TK M1D02wW45Rrj5tCP9dzvNzUA/hwLnlL60Bogjap6/aBVmZp3iKibgZKkw25l+0fNiO9d wuRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=KyfNfQnQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w6-v6si90026pgb.61.2018.07.16.22.33.22; Mon, 16 Jul 2018 22:33:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=KyfNfQnQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727821AbeGQGDd (ORCPT + 99 others); Tue, 17 Jul 2018 02:03:33 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:45487 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726754AbeGQGDd (ORCPT ); Tue, 17 Jul 2018 02:03:33 -0400 Received: by mail-pg1-f194.google.com with SMTP id f1-v6so259347pgq.12 for ; Mon, 16 Jul 2018 22:32:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=1IjHaOgEjZD2spV2dDvxU8iK7OSWSfmBppTX7LrDDHY=; b=KyfNfQnQn3pyqMl8YT6L5nhNMgDbFfCgmdnTiOAcLUcxrIFdU8uTQetMW+FCClANJC YcMm+X/alWYfzs1ZpYoGKkiLcCM5Zlb5q9QAqKk3XLJf+OVJraqA1l9IK0ESawrPpc3m X3rXqK6vrdORbzXL5ZvYg9IrjFjd8+BYm3fByclKPNQbR4wQyOITDyPfQBDlROfHBkoA zAGK1/4rWbwl62WCvknaiACuxisstZr44kvNCaN7oA10MV3Tpw21KAoExDwFgIaiG/bw Yzh/epLYTabm4B/iM/HK2bTwBFo+sfWjA8hGUE9j9JWNdLCIRjdXG8gedX5ZlmlNu47N q6Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=1IjHaOgEjZD2spV2dDvxU8iK7OSWSfmBppTX7LrDDHY=; b=gcNQ6FKE29279/3drQeOs3b5D4MlwV6I38mQMQbrqTmj58SEZ/pc2RIqrGMXlidFam e0GBTJwZWabZNVIKg8/5aE/0WMGJMf+b9zuB4Rj3WanX7IyfoOnqzMENOor24CHAyvd9 YD4sqM4+HanUktr1WLv/2UzPSJ+y8TLqgFd3KHrZLwoVD6ZkaMqmpVWI9t0F6h2z0zVk xDUoST7sl1DFqvaaCZa/OqvoKBuuJC8br4BxRnXRf8oQEotOfGREuvk3OtAp2OS0GqyZ AWvsvrrkqHIOdgiWVAD8hc/S2/Qu5CzrCHQ9TSid8eQZhKuyWzcFHEwkHATLzNbtzDUD 54ww== X-Gm-Message-State: AOUpUlFlu/hggt5w39hcXFlYA1pG0bhIb1xv5BeAFcrWiCAJthNW19i4 6Itctginl5VE0xUgUtr3ycmT X-Received: by 2002:a65:4107:: with SMTP id w7-v6mr182405pgp.302.1531805565089; Mon, 16 Jul 2018 22:32:45 -0700 (PDT) Received: from www9186uo.sakura.ne.jp (www9186uo.sakura.ne.jp. [153.121.56.200]) by smtp.gmail.com with ESMTPSA id y85-v6sm156220pfa.170.2018.07.16.22.32.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jul 2018 22:32:44 -0700 (PDT) From: Naoya Horiguchi To: linux-mm@kvack.org Cc: Michal Hocko , Andrew Morton , xishi.qiuxishi@alibaba-inc.com, zy.zhengyi@alibaba-inc.com, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/2] mm: soft-offline: fix race against page allocation Date: Tue, 17 Jul 2018 14:32:30 +0900 Message-Id: <1531805552-19547-1-git-send-email-n-horiguchi@ah.jp.nec.com> X-Mailer: git-send-email 2.7.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I've updated the patchset based on feedbacks: - updated comments (from Andrew), - moved calling set_hwpoison_free_buddy_page() from mm/migrate.c to mm/memory-failure.c, which is necessary to check the return code of set_hwpoison_free_buddy_page(), - lkp bot reported a build error when only 1/2 is applied. > mm/memory-failure.c: In function 'soft_offline_huge_page': > >> mm/memory-failure.c:1610:8: error: implicit declaration of function > 'set_hwpoison_free_buddy_page'; did you mean 'is_free_buddy_page'? > [-Werror=implicit-function-declaration] > if (set_hwpoison_free_buddy_page(page)) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ > is_free_buddy_page > cc1: some warnings being treated as errors set_hwpoison_free_buddy_page() is defined in 2/2, so we can't use it in 1/2. Simply doing s/set_hwpoison_free_buddy_page/!TestSetPageHWPoison/ will fix this. v1: https://lkml.org/lkml/2018/7/12/968 Thanks, Naoya Horiguchi --- Summary: Naoya Horiguchi (2): mm: fix race on soft-offlining free huge pages mm: soft-offline: close the race against page allocation include/linux/page-flags.h | 5 +++++ include/linux/swapops.h | 10 --------- mm/hugetlb.c | 11 +++++----- mm/memory-failure.c | 53 ++++++++++++++++++++++++++++++++++++++-------- mm/migrate.c | 11 ---------- mm/page_alloc.c | 30 ++++++++++++++++++++++++++ 6 files changed, 84 insertions(+), 36 deletions(-)