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 X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB21BC5CFE7 for ; Wed, 11 Jul 2018 04:04:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 688C420883 for ; Wed, 11 Jul 2018 04:04:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 688C420883 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726226AbeGKEG0 (ORCPT ); Wed, 11 Jul 2018 00:06:26 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:49294 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725818AbeGKEG0 (ORCPT ); Wed, 11 Jul 2018 00:06:26 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F33477C6CA; Wed, 11 Jul 2018 04:04:08 +0000 (UTC) Received: from redhat.com (ovpn-120-112.rdu2.redhat.com [10.10.120.112]) by smtp.corp.redhat.com (Postfix) with SMTP id 1F3C7111AF30; Wed, 11 Jul 2018 04:04:01 +0000 (UTC) Date: Wed, 11 Jul 2018 07:04:01 +0300 From: "Michael S. Tsirkin" To: Linus Torvalds Cc: wei.w.wang@intel.com, virtio-dev@lists.oasis-open.org, Linux Kernel Mailing List , virtualization , KVM list , linux-mm , Michal Hocko , Andrew Morton , Paolo Bonzini , liliang.opensource@gmail.com, yang.zhang.wz@gmail.com, quan.xu0@gmail.com, nilal@redhat.com, Rik van Riel , peterx@redhat.com Subject: Re: [PATCH v35 1/5] mm: support to get hints of free page blocks Message-ID: <20180711070318-mutt-send-email-mst@kernel.org> References: <1531215067-35472-1-git-send-email-wei.w.wang@intel.com> <1531215067-35472-2-git-send-email-wei.w.wang@intel.com> <20180711064709-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180711064709-mutt-send-email-mst@kernel.org> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 11 Jul 2018 04:04:09 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 11 Jul 2018 04:04:09 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 11, 2018 at 07:00:37AM +0300, Michael S. Tsirkin wrote: > On Tue, Jul 10, 2018 at 10:33:08AM -0700, Linus Torvalds wrote: > > NAK. > > > > On Tue, Jul 10, 2018 at 2:56 AM Wei Wang wrote: > > > > > > + > > > + buf_page = list_first_entry_or_null(pages, struct page, lru); > > > + if (!buf_page) > > > + return -EINVAL; > > > + buf = (__le64 *)page_address(buf_page); > > > > Stop this garbage. > > > > Why the hell would you pass in some crazy "liost of pages" that uses > > that lru list? > > > > That's just insane shit. > > > > Just pass in a an array to fill in. > > No idiotic games like this with > > odd list entries (what's the locking?) and crazy casting to > > > > So if you want an array of page addresses, pass that in as such. If > > you want to do it in a page, do it with > > > > u64 *array = page_address(page); > > int nr = PAGE_SIZE / sizeof(u64); > > > > and now you pass that array in to the thing. None of this completely > > insane crazy crap interfaces. > > Question was raised what to do if there are so many free > MAX_ORDER pages that their addresses don't fit in a single MAX_ORDER > page. Oh you answered already, I spoke too soon. Nevermind, pls ignore me.