Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3942919ybl; Mon, 3 Feb 2020 09:26:51 -0800 (PST) X-Google-Smtp-Source: APXvYqwhf5RAqZ+gE9XaXAjmfExYvmVfpfmNzeZJtcG//YlYtYZbRcb418wWmATqIOyRPcWGysQq X-Received: by 2002:a9d:798e:: with SMTP id h14mr17992563otm.257.1580750811335; Mon, 03 Feb 2020 09:26:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580750811; cv=none; d=google.com; s=arc-20160816; b=QlMaUVib/159HguPWdmULhTItYLyD8dxD+k5WuYquAKQn6WIuKksnN53yGzyehS6sv L8eedVr4JXIVmrzZylxI+ZE+Vfbpo6ddK90jqSiC+07V4OvSszsUG09AYtmtPrK87Nbe pEoTrH2/lE4Zb4OzE7hPwGW5bGFMfhwcu/pxZSLogcJR3GCS3hH2B5oMnGIXA5y01D3O 9OSv2D2DcDY34VkDHQnpGI5Ng7Kur+of8Li/NPYFEznGnfNp5UV3V34vsQwcpBQnNJfu 7iuoUjl7PO5Kl9KBGfGsIV8zmTld2ILe3FE9EpytOcUhBmTeb8So1LOL2OjbqmsCmRKU ElgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=J9cgaeMLTaJECRcYqxABSftFV/5KWVEItmdNxoAd1kk=; b=SzTgvoiqezpPqd/fR9pAMpA/A80RMyDrO+zwmgFWEyshn6/G9COZZekAlrsB7BbbPs iTEJ2iyIW42FFTLKuqfkEWZImTVX6LBM+dZDuKfosE61oVCW6/sXEQAUsNznkKpEwXHU 2fGHEgFldCRxdd71pk55kpk6PPs5E0x8em1eTSOwD0ThjHOX8zZKygmFA4gQQr1nyQsC n/KF61d+0SvhxHhMRnLsBbiTu9RTiwbZ/yHSCPoxLjD9DyK/bhXe9tcYte2fph5I6xhT GV0vYqsLxKjHc4v4HHwq6PqJRtO4gCjLCTsdIqoNs33mTLo2mj+rxuwU13McXC5ae1mi B1Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=R+l3zA+j; 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 j20si9710746otp.147.2020.02.03.09.26.38; Mon, 03 Feb 2020 09:26:51 -0800 (PST) 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=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=R+l3zA+j; 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 S1727722AbgBCPSe (ORCPT + 99 others); Mon, 3 Feb 2020 10:18:34 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:41392 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727201AbgBCPSe (ORCPT ); Mon, 3 Feb 2020 10:18:34 -0500 Received: by mail-lj1-f194.google.com with SMTP id h23so15046108ljc.8 for ; Mon, 03 Feb 2020 07:18:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=J9cgaeMLTaJECRcYqxABSftFV/5KWVEItmdNxoAd1kk=; b=R+l3zA+jNPp4j3NEVCD/WguynL5ltM98xpOCFsqcdd6u3ePAmhIrTzIzlNZK58nZb/ 6N+De1oZJUAwAPmzSiNSFeF+9oQ34uemRwKeyHwM/QRdIWzIsqNz/IGlTHexGVQb2cRx eKYV78sRevdg4SczLQ/iGOayOH9g3hTDCPePwEpiJapkvwbbLxTuWa8FUo0G7W1ViF5j At/LijsaN8RkI4qFEWITlT0Hs3OTPRevQtb/J6XFlU9gwSyVNybe925U1Hu7pcFcG2WY H1hN5LS9tCqu7Qhx2u2F+kCaO0lwJmYUalMbr+55plBjXahEbE4PbbTPHht4peZQZifz z14Q== 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; bh=J9cgaeMLTaJECRcYqxABSftFV/5KWVEItmdNxoAd1kk=; b=t3GfWMcmkj8QWpckiHy++iiI1ojdUnWmz2Zj/oUY8NSUIiNdDO7q1gyiiTh0MmoYX4 yr3dOaBLwviwECjiRFklMNn1F41to7tJUCBEwvfXbh+OSD6jlbeR8kDfAspsw5FrUDPP 4w2ubUsUTP51BIN56VGSqQ00pueF/dHrZNehmmaHaSYbI0LPxUgvF5GpcZaE6VWlov2k aZIYoFDu0uPzu+oD5QFGFVDzpszzBvuG72bHYdatMzvfbg5CSDLJhUCXPuqcVDQ8qfgW VUXmZQUgpbVxBbk9Huf/I4tJx/A3n1AULtV7RKqD+/FAN3ubmNBN01X8fbc55F0NYfRD cMXg== X-Gm-Message-State: APjAAAXMuRAYn696WLHaviTz5DAxrraonb4X/GqTNt+kMbne//VtsJMC NsUNtGmpNlCrLGkCECChhcuKUg== X-Received: by 2002:a2e:9b90:: with SMTP id z16mr13423303lji.254.1580743112406; Mon, 03 Feb 2020 07:18:32 -0800 (PST) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id h10sm9835670ljc.39.2020.02.03.07.18.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Feb 2020 07:18:31 -0800 (PST) Received: by box.localdomain (Postfix, from userid 1000) id 6D693100996; Mon, 3 Feb 2020 18:18:44 +0300 (+03) Date: Mon, 3 Feb 2020 18:18:44 +0300 From: "Kirill A. Shutemov" To: Chris Wilson Cc: "Kirill A. Shutemov" , Andrea Arcangeli , Andrew Morton , Hugh Dickins , Dave Hansen , Mel Gorman , Rik van Riel , Vlastimil Babka , Christoph Lameter , Naoya Horiguchi , Steve Capper , "Aneesh Kumar K.V" , Johannes Weiner , Michal Hocko , Jerome Marchand , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 09/16] page-flags: define PG_reserved behavior on compound pages Message-ID: <20200203151844.mmgcwzz3igo7h6wj@box> References: <1426784902-125149-1-git-send-email-kirill.shutemov@linux.intel.com> <1426784902-125149-10-git-send-email-kirill.shutemov@linux.intel.com> <158048425224.2430.4905670949721797624@skylake-alporthouse-com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <158048425224.2430.4905670949721797624@skylake-alporthouse-com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 31, 2020 at 03:24:12PM +0000, Chris Wilson wrote: > Quoting Kirill A. Shutemov (2015-03-19 17:08:15) > > As far as I can see there's no users of PG_reserved on compound pages. > > Let's use NO_COMPOUND here. > > Much later than you would ever expect, but we just had a user update an > ancient device and trip over this. > https://gitlab.freedesktop.org/drm/intel/issues/1027 > > In drm_pci_alloc() we allocate a high-order page (for it to be physically > contiguous) and mark each page as Reserved. > > dmah->vaddr = dma_alloc_coherent(&dev->pdev->dev, size, > &dmah->busaddr, > GFP_KERNEL | __GFP_COMP); > > /* XXX - Is virt_to_page() legal for consistent mem? */ > /* Reserve */ > for (addr = (unsigned long)dmah->vaddr, sz = size; > sz > 0; addr += PAGE_SIZE, sz -= PAGE_SIZE) { > SetPageReserved(virt_to_page((void *)addr)); > } > > It's been doing that since > > commit ddf19b973be5a96d77c8467f657fe5bd7d126e0f > Author: Dave Airlie > Date: Sun Mar 19 18:56:12 2006 +1100 > > drm: fixup PCI DMA support > > I haven't found anything to say if we are meant to be reserving the > pages or not. So I bring it to your attention, asking for help. I don't see a real reason for these pages to be reserved. But I might be wrong here. I tried to look around: other users (infiniband/ethernet) of dma_alloc_coherent(__GFP_COMP) don't mess with PG_reserved. Could you try to drop it from DRM? -- Kirill A. Shutemov