Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4818782imm; Mon, 17 Sep 2018 23:01:02 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY33amhKwI7OHpxjDOfvWHUnqhQqdO03kP9HPw+ss++yLU9LNuXLYzrr24iS0LG6mbZ6mDY X-Received: by 2002:a63:6183:: with SMTP id v125-v6mr26771786pgb.242.1537250462061; Mon, 17 Sep 2018 23:01:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537250462; cv=none; d=google.com; s=arc-20160816; b=HVKYDcEixHOEyTfE0FK/a2dmfkHs9qsbV3c9zGIDVbYMgz+Gn6oD/jf9l+KZF7GOou kziSbnWwKMOW3FS9+3nyAveNvaSipYCdeGU2HdZZM/AhUAf3lxFdRvaYURfE4wTPzNOC q0fBb5E2yFE791HufnF93IZdSCBfbDFvgZEjMCYlNiU7nh+UlcwXn4IXTLBJjA6QyHCg 6JaDmtYH95S2zhOXkAg+w8d00e2QgjYyJUMxfRJfsypSeF5CYMqbvLeefTULAAZRlfhJ jHYYMBUxf0MvGGbGlHKYQjbS7KS9YY7CoSQOwkpeyf9GQ1e5tYhtLoWyuJOYRp+QMs+Q tu9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=JoCDdnUkD7o5IrNl3TI40egmg9e0KqbSrhA98FhS5cM=; b=InIRjaS3YfpfPVjRpOG/sub0B5YRe5iqcTPlo0/HO7eGjnwqyqY6LQLC8Omkv3xzl1 aF01fY7GB/NRSo29hYMUflWbBmziwzU4omMPpms9SuRFXKKro+0fMNgMBTuMC8qxnnRB iNp+rpvCbVPoCtc5bj/pX+eNwGw+mCmYbpXwX6zUKmKB1KAcfFPgQXvhaixpB/KMSPUC /Ra2x/gzDqml+mHuYFWM4BiSz3lxzVAbseL+acKKLUOUd1kh4XXgz/YACgLM/RxeqBD/ vFUMlryQG6aimCM97vcB49tDaA2PfENEaZXDwJ0pZxiMTjgUt1Rsuv5QR6jnatPZU51V 8oSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=X52pU1CK; 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 i6-v6si19700863pfg.175.2018.09.17.23.00.45; Mon, 17 Sep 2018 23:01:02 -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=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=X52pU1CK; 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 S1727563AbeIRLbk (ORCPT + 99 others); Tue, 18 Sep 2018 07:31:40 -0400 Received: from mail-by2nam01on0042.outbound.protection.outlook.com ([104.47.34.42]:10304 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726414AbeIRLbk (ORCPT ); Tue, 18 Sep 2018 07:31:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JoCDdnUkD7o5IrNl3TI40egmg9e0KqbSrhA98FhS5cM=; b=X52pU1CKRTtLbA+YyFPTiFLK7gZAJ+/smOZhnpaAZHFsO/Zc4jOzxZKTptsdxA2V/VFmSQhvplek7h/ZnVFBcJUfX69672SIXzlNxSc33qTVJUYMQ32t6RBVECVReUEypdCtppnyQYAkYEUP5ROhI4myAWlqPFqMR62pRpULMZQ= Received: from DM5PR12CA0006.namprd12.prod.outlook.com (2603:10b6:4:1::16) by BN4PR12MB0739.namprd12.prod.outlook.com (2a01:111:e400:59bc::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Tue, 18 Sep 2018 06:00:20 +0000 Received: from CO1NAM03FT041.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::207) by DM5PR12CA0006.outlook.office365.com (2603:10b6:4:1::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1143.15 via Frontend Transport; Tue, 18 Sep 2018 06:00:14 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by CO1NAM03FT041.mail.protection.outlook.com (10.152.81.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.1164.13 via Frontend Transport; Tue, 18 Sep 2018 06:00:13 +0000 Received: from [10.237.40.91] (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server (TLS) id 14.3.389.1; Tue, 18 Sep 2018 01:00:10 -0500 Subject: Re: [PATCH] list: introduce list_bulk_move_tail helper To: =?UTF-8?Q?Christian_K=c3=b6nig?= , , , References: <20180917120834.13993-1-christian.koenig@amd.com> From: "Zhang, Jerry(Junwei)" Message-ID: <84fbcd38-8433-1e87-e6e9-90dcb96168a9@amd.com> Date: Tue, 18 Sep 2018 14:00:04 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180917120834.13993-1-christian.koenig@amd.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [10.34.1.3] X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(136003)(346002)(376002)(396003)(2980300002)(428003)(189003)(199004)(486006)(77096007)(97736004)(68736007)(186003)(305945005)(7736002)(16526019)(6116002)(58126008)(110136005)(426003)(356003)(16576012)(316002)(53546011)(53936002)(446003)(47776003)(336012)(6666003)(26005)(229853002)(36756003)(3846002)(65956001)(64126003)(65806001)(126002)(476003)(50466002)(86362001)(23676004)(76176011)(11346002)(81166006)(2616005)(6246003)(8676002)(65826007)(39060400002)(81156014)(2201001)(67846002)(8936002)(105586002)(106466001)(31696002)(478600001)(2870700001)(104016004)(5660300001)(2906002)(31686004)(72206003)(2486003);DIR:OUT;SFP:1101;SCL:1;SRVR:BN4PR12MB0739;H:SATLEXCHOV02.amd.com;FPR:;SPF:None;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM03FT041;1:kWza2C8I4FeW0lIkzG8x+jM+TzO16vgp62Vx7Lf/bt7oeETawawGfUyh4Ao2euo+Mf/IdPG4RKs13cpCnXy3SO8HprunQ1pxtIZqRniIUJranq+PEetR410SgjCLPWro X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bef3cdda-4d56-442b-98b8-08d61d2c003d X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BN4PR12MB0739; X-Microsoft-Exchange-Diagnostics: 1;BN4PR12MB0739;3:xUOKWEby9bM11sZ+9jQ07G8s6Nbgyzz9aUyBeqcYMOuj/sTwaSNNs4xH4SS3zfjlbgUNPQLSUjcKHTkQCfgYQAWnKwxSeRzhVdFNyU2HHXIOKHt7DhSsbg45HQQoV60apP0+gbO47e87n849oEBst8nrdwvEi/r/TaJ1KHy4hfg8DXg7KVVnPEbbIQCNaEhH6pM6t8o5kgqWQ3m0zTnHKSfvkfTDovKIwLN8MdvReb8oQ3s8Od93Lx323ev/e0waI6cpNGJX8CNw3bQWFOOWROtTfOyLFeQ0qcodPcHmj3lt77Aa2TWQ0T/aVqB4H9aO/ACSWWtXCbOQ40ms1byTzaAOAHlCqgkISLql4ARG/E0=;25:gvoVyyKSQrvOx0tiqW/NUSvNoH94W/Np+IxpO3gmP7UldOWt7YOKO0bXMP3OfVd/sdHpDdiAFEO0thG1/wH0utRlFfAQg2LJuVpZhp7mI2nLFpvfCKdGnM8bveUTbbGrs6WnljjjBgnUTLGiw9gg92d+k1xFnP5I380TXPTuV2k1vv/oxGKJcA/Ix0waDb9zlcrliy7PkHIE+4q/SSePu6J9FW7V77LLCsd8BtzEvTwS2yIGaWqgCx5SjAwN5qXBlFXkZOzG4KGBEubJRztsNv2yIKxL2UDN9rMU7qXBzewh4R3MvFMx171GaNdy95yDOci3+li7WedgGTmDA/f6tg== X-MS-TrafficTypeDiagnostic: BN4PR12MB0739: X-Microsoft-Exchange-Diagnostics: 1;BN4PR12MB0739;31:nnPbJJ8vN/yVjuhBB+Yl7ATnBA3ct1kGfwEzLQ2SEKXqn0OLYeY+miTC9gcqPpghaOHT4548R/CsjFm7Im2KW0p2IhQx08g02Eh3xBuYjxog0O908YsAzmLs+xdpXsrsBEfu0IZgVGY0hUXS41GRH98tdWv/JMtxpdu57Z34Z1wNBOT14X5lWdJxCI0eyrS8FzZxLEzafe4BaZc7p0zixVbt80qilP5VAtjX021CM7o=;20:q/U59oBTLaehC/yMC0np2U6nC91QEzTg21Rj3jkSMC61QrrpQbio+UJ2gDaoQ27LjciHoVzU8Oy1iafeMIQn9E49j58YRkooS1zOwlVmVvmnmsNOK8D1eUBkeA7uxlZSTZAbokg4msi9DmbEAWwPGFECYSs5A6ia/l4H3UpOQeOOs1KP2C8aZZtv0R0lrzI99LwlgYa/8b0xqU/44+ktafldiB5FKZzmC9aCL72hE7T5EZov4J3JS98VnlJnqiS4Ma0tJU9p+JJFTohTcdvmwf6TMmUzr+Gn/mhRF1krJLyEc0NvU/PxrT+OGDnO4/Crkp/I52fsQhHah6U5IuLuZ9wcK7dr40Uqcy8BfLK65INua5d7hnfr9nOsg6FxBdQxu7+v62SmR/x2YYNbWyiY53ptrifgM4YcBVI6Q5DVIFXH+XHI3/EXzaesWVQo8EDB+KsdyE8uEjDVToSZy9XABNerl/SRC1pWj9O8Wc4EvYOO+kjIvXcMTP2GgG0kQsL6 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93003095)(3231355)(944501410)(52105095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699050);SRVR:BN4PR12MB0739;BCL:0;PCL:0;RULEID:;SRVR:BN4PR12MB0739; X-Microsoft-Exchange-Diagnostics: 1;BN4PR12MB0739;4:54wSIHKnz+gKVqRIITTpfPOJ0UAjPHrfom8ZDa3jOzsAvaQ4+cZnkAretir2Aw74VtxC7sE9WyipoylPCHp3Zhl5pfh5bpSXqH4Yi6FIesSotZGu0CQEL7+jvkeQIebajKLjAYuyGvLL5yWw6Zd+Q92XDTyRIPQbWG8GKPrF0OeHsbjEBmZj9rLZzGTUJl2SPnF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jBJCXh6tcce481pCxhPRfiZSK0nX2SgsuQxfRoHJEP+8Nd72uZBuAUx+t2P12u2MYPiy8vqDhhtSubgaZ000Iuf+cVzXqWDRwEqtmeoIFJmk88ejiQV3xN+MAiii/UbwdWH+/YUTmjMrNdyFaOQuuotwOAO3pRNWPOqyd7h8DUoSbOCrAAA4MSnFIsSen1gq3IU2XktQpwfbvzOhw==;5:XGsXOTygW6PwSIiESPtxT0/DIss5yMoGbrhsFBg9AHVZC2JDJwSomuVwUj8+yM48+vN5WZMwwbslXvsrEuq5iGSkJZb6FN5YSZKcV2LPvHpKmQAUNSrdY0DvwVWSp9Z+XozjN7g5PadQXBU2TQvN4arZ/YN+p2SDHhlZwKD/3pM=;7:0NzuLLdfQp5Yp6DmRO3RaOCdTNudRsFulT8TfsCITlwt+F8QLgwgK1wdmhE/+8207q4u1sXeRNBIhpvDF+ZbO6FJ744L9nUcybfEMKHNvsGIO8yU9dL9W5nrC4N8emKOCNIBpLL5wpCNWJgWVRj6MRnLJHXRhYzNLN6tyDZ2qsVWsYWKWZX1iD6UdRFZR28HifLVADfmnY7I+UOdbEYz+v6CEI2hjtSxO7CtNckSfZOaa5emAMMFYSoFhqSAxwip SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BN4PR12MB0739;20:13y2O/TqvCcBxmxruhq+2poJ038uTvMepgTOVFBw65VV3fV1XprdRbx8CXuoTTP181ArYndkZC5hlT2/YrqwyMAX6a2E/3jQJVk6pqQlGhK3ZHwuEFPHFhzbYYU8ITqIscVZTWLjl3CoPBXl1koWcI47uz6sjIg89BHSD2RbqmoeJLNtN8UUv/G6LydZhdqP/sxwrywZPz01ZPCvFVLbAkO3qdnsBpl7sz0SmzVi2npWwu/hiWHKwM9gNCPv/HVC X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2018 06:00:13.5708 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bef3cdda-4d56-442b-98b8-08d61d2c003d X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN4PR12MB0739 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/17/2018 08:08 PM, Christian König wrote: > Move all entries between @first and including @last before @head. > > This is useful for LRU lists where a whole block of entries should be > moved to the end of the list. > > Used as a band aid in TTM, but better placed in the common list headers. > > Signed-off-by: Christian König Reviewed-by: Junwei Zhang > --- > drivers/gpu/drm/ttm/ttm_bo.c | 25 +++++-------------------- > include/linux/list.h | 23 +++++++++++++++++++++++ > 2 files changed, 28 insertions(+), 20 deletions(-) > > diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c > index b2a33bf1ef10..26b889f86670 100644 > --- a/drivers/gpu/drm/ttm/ttm_bo.c > +++ b/drivers/gpu/drm/ttm/ttm_bo.c > @@ -247,20 +247,6 @@ void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo, > } > EXPORT_SYMBOL(ttm_bo_move_to_lru_tail); > > -static void ttm_list_move_bulk_tail(struct list_head *list, > - struct list_head *first, > - struct list_head *last) > -{ > - first->prev->next = last->next; > - last->next->prev = first->prev; > - > - list->prev->next = first; > - first->prev = list->prev; > - > - last->next = list; > - list->prev = last; > -} > - > void ttm_bo_bulk_move_lru_tail(struct ttm_lru_bulk_move *bulk) > { > unsigned i; > @@ -276,8 +262,8 @@ void ttm_bo_bulk_move_lru_tail(struct ttm_lru_bulk_move *bulk) > reservation_object_assert_held(pos->last->resv); > > man = &pos->first->bdev->man[TTM_PL_TT]; > - ttm_list_move_bulk_tail(&man->lru[i], &pos->first->lru, > - &pos->last->lru); > + list_bulk_move_tail(&man->lru[i], &pos->first->lru, > + &pos->last->lru); > } > > for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i) { > @@ -291,8 +277,8 @@ void ttm_bo_bulk_move_lru_tail(struct ttm_lru_bulk_move *bulk) > reservation_object_assert_held(pos->last->resv); > > man = &pos->first->bdev->man[TTM_PL_VRAM]; > - ttm_list_move_bulk_tail(&man->lru[i], &pos->first->lru, > - &pos->last->lru); > + list_bulk_move_tail(&man->lru[i], &pos->first->lru, > + &pos->last->lru); > } > > for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i) { > @@ -306,8 +292,7 @@ void ttm_bo_bulk_move_lru_tail(struct ttm_lru_bulk_move *bulk) > reservation_object_assert_held(pos->last->resv); > > lru = &pos->first->bdev->glob->swap_lru[i]; > - ttm_list_move_bulk_tail(lru, &pos->first->swap, > - &pos->last->swap); > + list_bulk_move_tail(lru, &pos->first->swap, &pos->last->swap); > } > } > EXPORT_SYMBOL(ttm_bo_bulk_move_lru_tail); > diff --git a/include/linux/list.h b/include/linux/list.h > index de04cc5ed536..edb7628e46ed 100644 > --- a/include/linux/list.h > +++ b/include/linux/list.h > @@ -183,6 +183,29 @@ static inline void list_move_tail(struct list_head *list, > list_add_tail(list, head); > } > > +/** > + * list_bulk_move_tail - move a subsection of a list to its tail > + * @head: the head that will follow our entry > + * @first: first entry to move > + * @last: last entry to move, can be the same as first > + * > + * Move all entries between @first and including @last before @head. > + * All three entries must belong to the same linked list. > + */ > +static inline void list_bulk_move_tail(struct list_head *head, > + struct list_head *first, > + struct list_head *last) > +{ > + first->prev->next = last->next; > + last->next->prev = first->prev; > + > + head->prev->next = first; > + first->prev = head->prev; > + > + last->next = head; > + head->prev = last; > +} > + > /** > * list_is_last - tests whether @list is the last entry in list @head > * @list: the entry to test