Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1792918pxu; Thu, 8 Oct 2020 22:56:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEwleZnyN9L7q/taUDAfMq/+iqMBYqNjrZoWdAEr8U4hpA8GwkPYr+T6kb03h2huhw87GC X-Received: by 2002:a50:8e43:: with SMTP id 3mr13119037edx.178.1602222964956; Thu, 08 Oct 2020 22:56:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602222964; cv=none; d=google.com; s=arc-20160816; b=JOMSFRZbtLSslHNW0hkqTJYc1TXRVj49LAU+ts99GiyNqHT8vkctMX034f2KBV3Wng n2VJvvADYz6wxBy9XlwK0Q5zwXKeW4BXllp2XjIR73QTqWGanvyl31MyXUuoirPM6jWZ mhudMZB+QNt5aZgy2PEpJUivgOA2ARkI2yS5GyRx2u0FLhu5+1vj2aNrgLnVJEtNOUxD 146xdhNoMddXvsyVlrIxHmcj8dLU/9/f6Xto57OR2pZqRGSt6eF5Me4kgwC5hbyE1wGv gb5981pyBZ3O8B8pUXqcRZLh89mnMZkjZWobRyE83uPX5zh85VOy1cLXJ+qY87GVnRbj CBWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=9zZePxv1+ayzDeRnmmneH5yJgguBhYNYuZPZ3ryB+aY=; b=WKTHGZ1846MVJ5QU5KtARngeYxrH3B7gzB8HZZWDyXiuK/YJVW6t3NROA474Aw+z6W /tlwBhSzwub1R1+CdVuN5gVEMoaornYXl8KnzhNV4WajtVeGsU2z8NaKqqK45sBaZMni Dy4UEtNNKVte7TgYU43ObneZ4uzIgdv58NONpFYNv26nyZ+WTqLBAHuHlc8XywIZQ64y rI01HJf/hE4ZQBLs86V9To//qG0/kKef1VRqu0LLVLuyexfeufs6NbMUM1YzFpuoaYOe 3hULpa3Rnx6rbtgmIUUaxNf8m4ISFe654MxVZ4Ghb+h8KO0lgwASs5/NLRIwteL56+kU 24dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OlU1oasS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t9si5306054ejf.292.2020.10.08.22.55.41; Thu, 08 Oct 2020 22:56:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OlU1oasS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730462AbgJIBfh (ORCPT + 99 others); Thu, 8 Oct 2020 21:35:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725857AbgJIBfh (ORCPT ); Thu, 8 Oct 2020 21:35:37 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4A0AC0613D2 for ; Thu, 8 Oct 2020 18:35:35 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id g29so5872072pgl.2 for ; Thu, 08 Oct 2020 18:35:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=9zZePxv1+ayzDeRnmmneH5yJgguBhYNYuZPZ3ryB+aY=; b=OlU1oasSdq2JHGNSbvBEe2LNN/ZY3bfSNgkbsIpJQP5mL42tno8ZPR4A7oc0AELxAs mf7khMvAXcvIYWlm8MDYaxEvk1f9Fw18WqGLx3h9fijdqzXK1nfaH+5jTkQuvH7eJHtd bksuSzC901/tTuvI5ZVxdKT0opmMxQHVHHQ66EDk5a+HingLIXvMZGgPgvxZWX+8y7BT ew/H/8odV/o6SXNc3aQUFDx/oG9sdbetPEtWe0/ceqV3QIbOifMhZc0R9k1jk9mPY2f+ aCU5LY8VWY8X7wNj26XsDH6P/W6ri00hVXlit9I+2PhKmGE6ojB9O7UbOtaf/VYW6ce/ kXqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=9zZePxv1+ayzDeRnmmneH5yJgguBhYNYuZPZ3ryB+aY=; b=IlqkNcVa1c9AEYpb8dcf00o5CpOchVVX6taRzn26Zh9e4EDyY34tfIUIAV2EVg8JiN f4SJTEwprXWFcnQcFSG5axRFj+x4bKKrC/eFQZCiETsAzgUoMDavS2q4p04CwjFteRbS tBr+vqtoe5pzyYD/cVnKmixFy9pWEyYKyTuursB6gch4wpzqAkNXfPnwQvXU+zMcV1xh JqnjmkVfxeGt+ZbxLUVVJv2eaL2lHQS63t+blS1flyRGaU6KLO4/G31RhEEJNOWBtXem V3JeksNz4oF08H6VnqnwduBT2rqxccqT4s5dggch44yWe69J3qSSJMWn9Bvl5RqfpS52 na5A== X-Gm-Message-State: AOAM530ZJgRssI9o2HMwZ1jU+ynulgzymMa21N+SCmgabhKLBqXKnwTx BzqVi2yorJvrMSVGtgf81W0= X-Received: by 2002:a63:5c5f:: with SMTP id n31mr1312474pgm.397.1602207335265; Thu, 08 Oct 2020 18:35:35 -0700 (PDT) Received: from js1304-desktop ([114.206.198.176]) by smtp.gmail.com with ESMTPSA id j8sm8733508pfr.121.2020.10.08.18.35.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Oct 2020 18:35:34 -0700 (PDT) Date: Fri, 9 Oct 2020 10:35:12 +0900 From: Joonsoo Kim To: "Eric W. Biederman" Cc: Hari Bathini , kernel-team@lge.com, Michal Hocko , Minchan Kim , "Aneesh Kumar K . V" , Rik van Riel , "Rafael J . Wysocki" , LKML , Christian Koenig , Christoph Hellwig , Linux Memory Management List , Huang Rui , Kexec Mailing List , Pavel Machek , Johannes Weiner , Andrew Morton , Laura Abbott , Mel Gorman , Roman Gushchin , Vlastimil Babka Subject: Re: [RFC][PATCH] kexec: Teach indirect pages how to live in high memory Message-ID: <20201009013500.GA26932@js1304-desktop> References: <1588130803-20527-1-git-send-email-iamjoonsoo.kim@lge.com> <1588130803-20527-4-git-send-email-iamjoonsoo.kim@lge.com> <87h7wzvjko.fsf@x220.int.ebiederm.org> <87ftcfpzjn.fsf@x220.int.ebiederm.org> <87368fmkel.fsf_-_@x220.int.ebiederm.org> <54a53bfe-6929-2790-9b1d-943e9f47cd62@linux.ibm.com> <87sggekyzv.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87sggekyzv.fsf@x220.int.ebiederm.org> User-Agent: Mutt/1.5.24 (2015-08-30) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 05, 2020 at 01:39:16PM -0500, Eric W. Biederman wrote: > Hari Bathini writes: > > > On 05/05/20 3:29 am, Eric W. Biederman wrote: > >> > >> Recently a patch was proposed to kimage_alloc_page to slightly alter > >> the logic of how pages allocated with incompatible flags were > >> detected. The logic was being altered because the semantics of the > >> page alloctor were changing yet again. > >> > >> Looking at that case I realized that there is no reason for it to even > >> exist. Either the indirect page allocations and the source page > >> allocations could be separated out, or I could do as I am doing now > >> and simply teach the indirect pages to live in high memory. > >> > >> This patch replaced pointers of type kimage_entry_t * with a new type > >> kimage_entry_pos_t. This new type holds the physical address of the > >> indirect page and the offset within that page of the next indirect > >> entry to write. A special constant KIMAGE_ENTRY_POS_INVALID is added > >> that kimage_image_pos_t variables that don't currently have a valid > >> may be set to. > >> > >> Two new functions kimage_read_entry and kimage_write_entry have been > >> provided to write entries in way that works if they live in high > >> memory. > >> > >> The now unnecessary checks to see if a destination entry is non-zero > >> and to increment it if so have been removed. For safety new indrect > >> pages are now cleared so we have a guarantee everything that has not > >> been used yet is zero. Along with this writing an extra trailing 0 > >> entry has been removed, as it is known all trailing entries are now 0. > >> > >> With highmem support implemented for indirect pages > >> kimage_image_alloc_page has been updated to always allocate > >> GFP_HIGHUSER pages, and handling of pages with different > >> gfp flags has been removed. > >> > >> Signed-off-by: "Eric W. Biederman" > > > > Eric, the patch failed with data access exception on ppc64. Using the below patch on top > > got me going... > > Doh! Somehow I thought I had put that logic or something equivalent > into kimage_write_entry and it appears I did not. I will see if I can > respin the patch. > > Thank you very much for testing. Hello, Eric. It seems that this patch isn't upstreamed. Could you respin the patch? I've tested this one on x86_32 (highmem enabled) and it works well. Thanks.